Arcgis api For silverlight 加载QQ地图

简介: 原文 http://www.cnblogs.com/thinkaspx/archive/2012/11/07/2759079.html //本篇博客仅在技术上探讨可行性    //如果要使用Q 地图,请联系相关厂商 public class QQMapLayer : TiledMapServi...

原文 http://www.cnblogs.com/thinkaspx/archive/2012/11/07/2759079.html

//本篇博客仅在技术上探讨可行性 

  //如果要使用Q 地图,请联系相关厂商

public class QQMapLayer : TiledMapServiceLayer { private const double cornerCoordinate = 20037508.342787; public override void Initialize() { this.FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787) { SpatialReference = new SpatialReference(102113) }; // This layer's spatial reference this.SpatialReference = new SpatialReference(102113); // Set up tile information. Each tile is 256x256px, 19 levels. this.TileInfo = new TileInfo() { Height = 256, Width = 256, Origin = new MapPoint(-cornerCoordinate, cornerCoordinate) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102113) }, Lods = new Lod[20] }; // Set the resolutions for each level. Each level is half the resolution of the previous one. double[] resolution = new double[] { 156543.033928, 78271.5169639999, 39135.7584820001, 19567.8792409999, 9783.93962049996, 4891.96981024998, 2445.98490512499, 1222.99245256249, 611.49622628138, 305.748113140558, 152.874056570411, 76.4370282850732, 38.2185141425366, 19.1092570712683, 9.55462853563415, 4.77731426794937, 2.38865713397468, 1.19432856685505, 0.597164283559817, 0.298582141647617 };//cornerCoordinate * 2 / 256;// for (int i = 0; i < TileInfo.Lods.Length; i++) { //TileInfo.Lods[i] = new Lod() { Resolution = Math.Pow(2, 18 - i) }; TileInfo.Lods[i] = new Lod() { Resolution = resolution[i] }; } // Call base initialize to raise the initialization event base.Initialize(); } private string[] _subDomains = new string[] { "p0", "p1", "p2", "p3" }; private int[] scope = new int[] { 0, 0, 0, 0, 0, 3, 0, 3, 0, 3, 0, 3, 0, 7, 0, 7, 0, 15, 0, 15, 0, 31, 0, 31, 0, 63, 4, 59, 0, 127, 12, 115, 0, 225, 28, 227, 356, 455, 150, 259, 720, 899, 320, 469, 1440, 1799, 650, 929, 2880, 3589, 1200, 2069, 5760, 7179, 2550, 3709, 11520, 14349, 5100, 7999, 23060, 28689, 10710, 15429, 46120, 57369, 20290, 29849, 89990, 124729, 41430, 60689, 184228, 229827, 84169, 128886 }; public override string GetTileUrl(int level, int row, int col) { var subdomain = this._subDomains[(level + col + row) % this._subDomains.Length]; string baseUrl = "http://{0}.map.qq.com/maptiles/{1}"; // var f = level * 4; if (f == this.scope.Length) return ""; var i = this.scope[f++]; var j = this.scope[f++]; var l = this.scope[f++]; var scope = this.scope[f]; var tileNo = ""; if (col >= i && col <= j && row >= l && row <= scope) { row = (int)(Math.Pow(2, level) - 1 - row); tileNo = level + "/" + Math.Floor(col / 16) + "/" + Math.Floor(row / 16) + "/" + col + "_" + row + ".png"; } return string.Format(baseUrl, subdomain, tileNo); } }
目录
相关文章
|
6月前
|
人工智能 NoSQL 定位技术
标准地图的矢量模板,ArcGIS可打开
标准地图的矢量模板,ArcGIS可打开
89 0
|
4月前
|
人工智能 编解码 定位技术
ArcGIS导出AI或EPS格式的地图图片并在Adobe Illustrator中继续编辑
ArcGIS导出AI或EPS格式的地图图片并在Adobe Illustrator中继续编辑
|
4月前
|
存储 定位技术
ArcGIS中ArcMap导入mxd地图文档文件出现红色感叹号、地图空白的解决
ArcGIS中ArcMap导入mxd地图文档文件出现红色感叹号、地图空白的解决
|
4月前
|
编解码 定位技术 Python
Python中ArcPy实现ArcGIS自动批量制图与地图要素批量设置
Python中ArcPy实现ArcGIS自动批量制图与地图要素批量设置
|
9月前
|
定位技术
ArcGIS:地图单位和视图单位(显示单位)的区别?
ArcGIS:地图单位和视图单位(显示单位)的区别?
100 0
|
定位技术 文件存储 数据库管理
【ArcGIS教程】ArcGIS软件操作——地图配准
【ArcGIS教程】ArcGIS软件操作——地图配准
【ArcGIS教程】ArcGIS软件操作——地图配准
openlayer2 二:加载arcgis server图层
版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/bitree1/article/details/80755803 1.
1494 0
|
SQL Oracle 网络协议
从零开始发布一个ArcGIS Server地图服务
从零开始发布一个ArcGIS Server地图服务
405 0
从零开始发布一个ArcGIS Server地图服务
|
Web App开发 缓存 API
关于 SAP 电商云首页加载时触发的 OCC API 请求
关于 SAP 电商云首页加载时触发的 OCC API 请求
108 0
关于 SAP 电商云首页加载时触发的 OCC API 请求
|
Web App开发 API 开发者
关于 SAP 电商云首页加载时触发的 OCC API 请求
关于 SAP 电商云首页加载时触发的 OCC API 请求
129 0
关于 SAP 电商云首页加载时触发的 OCC API 请求

热门文章

最新文章