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); } }
目录
相关文章
|
8月前
|
缓存 数据可视化 定位技术
快递鸟快递API技术指南:获取物流轨迹信息与轨迹地图的解决方案
在当今电商竞争激烈的环境中,物流体验已成为提升用户满意度的关键因素。研究表明,超过 75% 的消费者会因物流信息不透明而放弃下单。
1736 1
|
JavaScript 前端开发 定位技术
百度地图JavaScript API v2.0创建地图
百度地图JavaScript API v2.0创建地图
318 0
|
定位技术 API
Angular 调用导入百度地图API接口,2024春招BAT面试真题详解
Angular 调用导入百度地图API接口,2024春招BAT面试真题详解
|
JavaScript 前端开发 定位技术
vue 使用 vue-jsonp 解决跨域请求问题(访问百度地图API)
vue 使用 vue-jsonp 解决跨域请求问题(访问百度地图API)
1149 0
|
域名解析 JavaScript 网络协议
技术心得记录:如何使用google地图的api(整理)
技术心得记录:如何使用google地图的api(整理)
2124 0
|
JavaScript API 网络架构
关于ArcGIS Rest API
ArcGIS Rest API:     9.3版本: http://resources.esri.com/help/9.3/arcgisserver/apis/rest/index.html     10版本:http://help.arcgis.com/en/arcgisserver/10.0/apis/rest/index.html ArcGIS Rest API 相当于对ArcGIS SOAP API的加上一层封装,即Rest Services是基于SOAP Services的,一般粗略的可以理解为SOAP Services 就是Web Services。
1200 0
|
8月前
|
缓存 监控 前端开发
顺企网 API 开发实战:搜索 / 详情接口从 0 到 1 落地(附 Elasticsearch 优化 + 错误速查)
企业API开发常陷参数、缓存、错误处理三大坑?本指南拆解顺企网双接口全流程,涵盖搜索优化、签名验证、限流应对,附可复用代码与错误速查表,助你2小时高效搞定开发,提升响应速度与稳定性。
|
9月前
|
数据可视化 测试技术 API
从接口性能到稳定性:这些API调试工具,让你的开发过程事半功倍
在软件开发中,接口调试与测试对接口性能、稳定性、准确性及团队协作至关重要。随着开发节奏加快,传统方式已难满足需求,专业API工具成为首选。本文介绍了Apifox、Postman、YApi、SoapUI、JMeter、Swagger等主流工具,对比其功能与适用场景,并推荐Apifox作为集成度高、支持中文、可视化强的一体化解决方案,助力提升API开发与测试效率。
|
8月前
|
JSON 算法 API
Python采集淘宝商品评论API接口及JSON数据返回全程指南
Python采集淘宝商品评论API接口及JSON数据返回全程指南
|
8月前
|
JSON API 数据安全/隐私保护
Python采集淘宝拍立淘按图搜索API接口及JSON数据返回全流程指南
通过以上流程,可实现淘宝拍立淘按图搜索的完整调用链路,并获取结构化的JSON商品数据,支撑电商比价、智能推荐等业务场景。