4.OsgEarth加载Mbtiles

愿你出走半生,归来仍是少年!

1.Mbtiles       

        mbtiles是在GIS开发中最常用的瓦片包格式,在移动端、桌面端都是常用的格式。

2.代码

        通过OsgEarth的MBTilesImageLayer图层进行加载,也是封装成了一个静态的方法方便调用。

/// 
///  创建离线的mbtiles瓦片图层
/// 
/// 文件地址
/// 格式
/// 
osgEarth::MBTilesImageLayer* Cv::LayerFactory::CreateMbtilesLayer(std::string fileFullName, std::string format)
{
	osgEarth::MBTilesImageLayer* ly = new osgEarth::MBTilesImageLayer();

	ly->setURL(osgEarth::URI(fileFullName));

	ly->setFormat(format);

	return ly;
}

3.效果

4.OsgEarth加载Mbtiles_第1张图片 mbtile加载效果

你可能感兴趣的:(Osg,c++,qt)