Archie osgEarth Step By Step ⑤OsgEarth开发指南——使用osgearth API编程动态建立地图
来源:互联网 发布:德雷蒙德格林体测数据 编辑:程序博客网 时间:2024/06/05 11:54
一种是使用earth文件,前面已经说过,还可以您使用osgearth API的时候以编程方式动态建立一个地图。
Osgearth也提供一个API供您动态创建地图。如果您的应用程序允许在运行时从不同层中选择一个层显示,那么这种方式就显得很有用。
- 建立一个地图对象
- 加入您认为合适的影像和高程地图
- 建立将渲染地图对象的地图节点
- 向场景加入你的地图节点
你可以在任何时候加入图层。但是,一旦向地图加入了一个图层,这张地图就有了选项的副本,你不能再改变它了。
#include <osgEarth/Map>#include <osgEarth/MapNode>#include <osgEarthDrivers/tms/TMSOptions>#include <osgEarthDrivers/gdal/GDALOptions>using namespace osgEarth;using namespace osgEarth::Drivers;...// Create a Map and set it to Geocentric to display a globeMap* map = new Map();// Add an imagery layer (blue marble from a TMS source){TMSOptions tms;tms.url() = "http://labs.metacarta.com/wms-c/Basic.py/1.0.0/satellite/";ImageLayer* layer = new ImageLayer( "NASA", tms );map->addImageLayer( layer );}// Add an elevationlayer (SRTM from a local GeoTiff file){GDALOptions gdal;gdal.url() = "c:/data/srtm.tif";ElevationLayer* layer = new ElevationLayer( "SRTM", gdal );map->addElevationLayer( layer );}// Create a MapNode to render this map:MapNode* mapNode = new MapNode( map );...viewer->setSceneData( mapNode );
- Archie osgEarth Step By Step ⑤OsgEarth开发指南——使用osgearth API编程动态建立地图
- Archie osgEarth Step By Step ⑤OsgEarth开发指南——使用osgearth API编程动态建立地图
- Archie osgEarth Step By Step④地图投影类型——墨卡托投影、高斯克吕格投影、UTM投影
- Archie osgEarth Step By Step④地图投影类型——墨卡托投影、高斯克吕格投影、UTM投影
- Archie osgEarth Step By Step②Earth File分析
- Archie osgEarth Step By Step②Earth File分析
- Archie osgEarth Step By Step③tif及geotiff文件格式简明分析
- Archie osgEarth Step By Step③tif及geotiff文件格式简明分析
- osgearth API编程动态建立一个地球!
- osgEarth Step By Step①我的第一个osgEarth程序
- osgEarth Step By Step①我的第一个osgEarth程序
- osgearth API编程动态建立一个地球【转】
- osgearth使用arcgis地图服务的问题
- osgEarth开发之OSG解构——失败的尝试
- OSGEarth绘制动态水效果
- osgEarth编译
- osgearth相关
- OsgEarth编译
- 登陆网站的python脚本
- 机器学习入门
- 新闻发布系统 (Asp.net 三层架构 )
- Linux Platform Device and Driver的注册过程解析
- UT-Exynos4412 三星ARM四核旗舰开发平台android4.0体验-8摄像头功能调试支持
- Archie osgEarth Step By Step ⑤OsgEarth开发指南——使用osgearth API编程动态建立地图
- ORA-12641 错误的一个解决办法
- VC++ 聊天框,仿QQ接收图片
- AnimationDrawable在2.2系统上开始动画后无法显示的问题
- android 多媒体和相机详解四 .
- 随机启动脚本修改Magento数据表core_config_data
- Linux中应用程序运行库错误问题的一种解决方法
- android 多媒体和相机详解五 .
- Disclaimer