一、加载天地图,使用的方法是
1、方法(向三维图层集合中添加第三方服务的三维图层。 )
public Layer3D Add(
string iserverURL,
string layerName,
string dataName,
double dDPI,
ImageFormatType imageType,
bool addToHead
)
iserverURL
Type: System..::.String
iServer数据服务的URL。
layerName
Type: System..::.String
指定新添加的三维图层的名称,不区分大小写。如果图层名称已存在,则抛出异常。
dataName
Type: System..::.String
数据名称。
dDPI
Type: System..::.Double
指定的DPI(分辨率)。
imageType
Type: SuperMap.Realspace..::.ImageFormatType
指定的缓存图片的格式。
addToHead
Type: System..::.Boolean
是否将新加载的图层加到最上面。
返回值
三维图层对象。
2、示例
/// <summary>
/// 获取天地图标签和影像图层
/// </summary>
internal void OpenImgLayers() {
string tduLayerUrl = "http://t0.tianditu.gov.cn/img_w/wmts?tk=855ff623d735789f262ec941e7f9bd21";
string tduLayerLabelUrl = "http://t0.tianditu.gov.cn/cia_w/wmts?tk=855ff623d735789f262ec941e7f9bd21";
m_sceneControl.Scene.Layers.Add(tduLayerUrl, "天地图影像图层", "img", 96, ImageFormatType.JPG_PNG, false);
m_sceneControl.Scene.Layers.Add(tduLayerLabelUrl, "天地图标签图层", "cia", 96, ImageFormatType.JPG_PNG, true);
m_sceneControl.Scene.Refresh();
Camera camera = new Camera();
camera.Longitude = 116.44806543462063;
camera.Latitude = 39.91225086488847;
camera.Altitude = 7.12500836700201;
camera.Heading = 87.4579968695009;
camera.Tilt = 78.577494932720839;
m_sceneControl.Scene.Fly(camera, 5);
}