目标:解决(一)中的问题
地图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