目标:解决(一)中的问题
地图map主要用于存放高层、影像、矢量等图层信息,为构建地图节点MapNode做准备。
osgEarthDrivers/earth/EarthFileSerialize2.cpp
osg::Node*
EarthFileSerializer2::deserialize( const Config& conf, const std::string& referrer ) const
{
osg::ref_ptr< Map > map = new Map( mapOptions );
// Start a batch update of the map:
map->beginUpdate();
// Read all the elevation layers in FIRST so other layers can access them for things like clamping.
// TODO: revisit this since we should really be listening for elevation data changes and
// re-clamping based on that..
for(ConfigSet::const_iterator i = conf.children().begin(); i != conf.children().end(); ++i)
{
// for backwards compatibility:
if (i->key() == "heightfield")
{
Config temp = *i;
temp.key() = "elevation";
addLayer(temp, map.get());
}
else if ( i->key() == "elevation" ) // || i-

本文深入探讨osgEarth的地图构建过程,重点关注地图map图层的构建,包括高层、影像、矢量图层的添加,以及osgEarth::Layer的详细信息。地图图层通过osgDB::Registry的读写器注册机制加载,图层信息在osgEarth::Map中处理后存储。待继续分析的内容涉及osg动态库插件加载、.earth文件解析、MapNode构建等。
最低0.47元/天 解锁文章
1036

被折叠的 条评论
为什么被折叠?



