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); } }
目录
相关文章
|
10月前
|
缓存 API 定位技术
使用Python调用百度地图API实现地址查询
使用Python调用百度地图API实现地址查询
565 0
|
7月前
|
JavaScript 前端开发 定位技术
百度地图JavaScript API v2.0创建地图
百度地图JavaScript API v2.0创建地图
100 0
|
8月前
|
JavaScript 前端开发 定位技术
vue 使用 vue-jsonp 解决跨域请求问题(访问百度地图API)
vue 使用 vue-jsonp 解决跨域请求问题(访问百度地图API)
392 0
|
9月前
|
域名解析 JavaScript 网络协议
技术心得记录:如何使用google地图的api(整理)
技术心得记录:如何使用google地图的api(整理)
681 0
|
10月前
|
定位技术 API
Angular 调用导入百度地图API接口,2024春招BAT面试真题详解
Angular 调用导入百度地图API接口,2024春招BAT面试真题详解
|
10月前
|
数据采集 分布式计算 DataWorks
DataWorks产品使用合集之DataWorks数据地图中的数据发现相关api接口调用如何解决
DataWorks作为一站式的数据开发与治理平台,提供了从数据采集、清洗、开发、调度、服务化、质量监控到安全管理的全套解决方案,帮助企业构建高效、规范、安全的大数据处理体系。以下是对DataWorks产品使用合集的概述,涵盖数据处理的各个环节。
89 0
|
10月前
|
JSON JavaScript 定位技术
Vue中使用echarts@4.x中国地图及AMap相关API的使用
Vue中使用echarts@4.x中国地图及AMap相关API的使用
363 0
Vue中使用echarts@4.x中国地图及AMap相关API的使用
|
10月前
|
人工智能 编解码 定位技术
ArcGIS导出AI或EPS格式的地图图片并在Adobe Illustrator中继续编辑
ArcGIS导出AI或EPS格式的地图图片并在Adobe Illustrator中继续编辑
413 1
|
10月前
|
存储 定位技术
ArcGIS中ArcMap导入mxd地图文档文件出现红色感叹号、地图空白的解决
ArcGIS中ArcMap导入mxd地图文档文件出现红色感叹号、地图空白的解决
232 1
|
10月前
|
编解码 定位技术 Python
Python中ArcPy实现ArcGIS自动批量制图与地图要素批量设置
Python中ArcPy实现ArcGIS自动批量制图与地图要素批量设置
266 1