Arcgis for Sliverlight 加载百度地图
来源:互联网 发布:测绘数据数据转换工具 编辑:程序博客网 时间:2024/06/05 03:38
加载百度地图类
using System;using System.Net;using System.Windows;using System.Windows.Controls;using System.Windows.Documents;using System.Windows.Ink;using System.Windows.Input;using System.Windows.Media;using System.Windows.Media.Animation;using System.Windows.Shapes;using ESRI.ArcGIS.Client;using ESRI.ArcGIS.Client.Geometry;public class baidumap : TiledMapServiceLayer{ private const double cornerCoordinate = 20037508.3427892; private string _baseURL = "Image"; //百度影像 public override void Initialize() { ESRI.ArcGIS.Client.Projection.WebMercator mercator = new ESRI.ArcGIS.Client.Projection.WebMercator(); this.FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(-20037508.3427892, -20037508.3427892, 20037508.3427892, 20037508.3427892) { SpatialReference = new SpatialReference(102100) }; //this.FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(9001735.65795624, 2919532.04645186, 19020489.8293508, 8346937.81802098) //{ // SpatialReference = new SpatialReference(102100) //}; //图层的空间坐标系 this.SpatialReference = new SpatialReference(102100); // 建立切片信息,每个切片大小256*256px,共16级. this.TileInfo = new TileInfo() { Height = 256, Width = 256, Origin = new MapPoint(-cornerCoordinate, cornerCoordinate) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100) }, Lods = new Lod[32] }; //为每级建立方案,每一级是前一级别的一半. double resolution = cornerCoordinate * 2 / 256; for (int i = 0; i < TileInfo.Lods.Length; i++) { TileInfo.Lods[i] = new Lod() { Resolution = resolution }; resolution /= 2; } // 调用初始化函数 base.Initialize(); } string _mapType = ""; public override string GetTileUrl(int level, int row, int col) { int zoom = level - 1; int offsetX = Convert.ToInt32(Math.Pow(2, zoom)); int offsetY = offsetX - 1; int numX = col - offsetX; int numY = (-row) + offsetY; zoom = level + 1; int num = (col + row) % 8 + 1; String url = null; if (MapType == "Map") { url = "http://online" + num + ".map.bdimg.com/tile/?qt=tile&x=" + numX + "&y=" + numY + "&z=" + zoom + "&styles=pl"; } else if (MapType == "Image") { url = " http://shangetu"+num+".map.bdimg.com/it/u=x=" + numX + ";y=" + numY + ";z=" + zoom + ";v=009;type=sate&fm=46"; } else if (MapType == "POI") { url = "http://online"+num+".map.bdimg.com/tile/?qt=tile&x=" + numX + "&y=" + numY + "&z=" + zoom + "&styles=sl&v=020"; } return string.Format(url); } public string MapType { get { return _mapType; } set { _mapType = value; } }}影像+标注
private void button2_Click(object sender, RoutedEventArgs e) { this.MyMap.Layers.Clear(); baidumap Alayer = new baidumap(); Alayer.MapType = "Image"; Alayer.Visible = true; this.MyMap.Layers.Add(Alayer); baidumap APOIlayer = new baidumap(); APOIlayer.MapType = "POI"; APOIlayer.Visible = true; this.MyMap.Layers.Add(APOIlayer); //中国范围 Envelope FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(9001735.65795624, 2919532.04645186, 19020489.8293508, 8346937.81802098) { SpatialReference = new SpatialReference(102100) }; this.MyMap.ZoomTo(FullExtent); }
矢量地图
private void buttonMap_Click(object sender, RoutedEventArgs e) { this.MyMap.Layers.Clear(); baidumap Alayer = new baidumap(); Alayer.MapType = "Map"; Alayer.Visible = true; this.MyMap.Layers.Add(Alayer); //中国范围 Envelope FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(9001735.65795624, 2919532.04645186, 19020489.8293508, 8346937.81802098) { SpatialReference = new SpatialReference(102100) }; this.MyMap.ZoomTo(FullExtent); }
0 0
- Arcgis for Sliverlight 加载百度地图
- Arcgis for js加载百度地图
- Arcgis for js加载百度地图
- Arcgis for js加载百度地图
- arcgis api for js 加载百度地图
- ArcGIS API for Javascript3.23加载百度地图
- ArcGIS API for Silverlight 加载google地图
- Arcgis For Android加载离线地图
- arcgis api for js 加载google地图
- arcgis for iOS10.2.5 地图加载
- Arcgis for flex 调用百度地图与Google地图
- Arcgis for javascript实现百度地图ABCD marker的效果
- Arcgis for javascript实现百度地图ABCD marker的效果
- 成功使用ArcGIS API for iOS加载Google地图
- ArcGIS API for Silverlight 地图加载进度条类之MapProgressBar
- ArcGIS API for Silverlight加载BingMap遥感地图
- ArcGIS API for Silverlight加载google地图(后续篇)
- ArcGIS Api For Android学习之(二)加载地图
- 大规模集成电路机
- 上楼梯问题
- 计算机是由硬件系统
- Windows的字符串
- 浙大 pat Basic Level 1018
- Arcgis for Sliverlight 加载百度地图
- 电源主板CPU内存
- 硬盘属于外部存储器
- android Properties的使用
- KVO 的概述与使用
- VS2010提示error TRK0002: Failed to execute command解决方法
- 去除chrome、safari表单元素获取焦点时黄色或蓝色边框
- Proguardgui
- 显卡网卡