Arcgis api For silverlight 加载QQ地图
原文 http://www.cnblogs.com/thinkaspx/archive/2012/11/07/2759079.html
//本篇博客仅在技术上探讨可行性
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()
};
// This layer's spatial reference
this.SpatialReference = new SpatialReference();
// Set up tile information. Each tile is 256x256px, 19 levels.
this.TileInfo = new TileInfo()
{
Height = ,
Width = ,
Origin = new MapPoint(-cornerCoordinate, cornerCoordinate) { SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference() },
Lods = new Lod[]
};
// 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 = ; 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[] { , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , };
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 * ;
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(, level) - - row); tileNo = level + "/" + Math.Floor(col / ) + "/" + Math.Floor(row / ) + "/" + col + "_" + row + ".png"; } return string.Format(baseUrl, subdomain, tileNo);
}
}
Arcgis api For silverlight 加载QQ地图的更多相关文章
- ArcGIS API for Silverlight 加载google地图
原文:ArcGIS API for Silverlight 加载google地图 using System; using System.Net; using System.Windows; using ...
- ArcGIS API for Silverlight加载google地图(后续篇)
原文:ArcGIS API for Silverlight加载google地图(后续篇) 之前在博客中(http://blog.csdn.net/taomanman/article/details/8 ...
- Arcgis api For silverlight 加载高德地图
原文 http://www.cnblogs.com/thinkaspx/archive/2012/11/13/2767752.html 地图仅供演示,研究使用.如要商用 请联系厂商. public c ...
- 解决ArcGIS API for Silverlight 加载地图的内外网访问问题
原文:解决ArcGIS API for Silverlight 加载地图的内外网访问问题 先上一个类,如下: public class BaseClass { public static string ...
- ArcGIS api for javascript——加载查询结果,悬停显示信息窗口
转自原文 ArcGIS api for javascript——加载查询结果,悬停显示信息窗口 描述 本例在开始和地图交互前执行一个查询任务并加在查询结果.这允许用户鼠标悬停在任意郡县时立即见到Inf ...
- OpenLayers加载QQ地图(转)
OpenLayers加载QQ地图 http://www.openlayers.cn/portal.php?mod=view&aid=4 2012-10-21 17:22| 发布者: admin ...
- ArcGIS API for Javascript 加载天地图(经纬度投影)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- ArcGIS API for Javascript 加载天地图(墨卡托投影)
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title> ...
- arcgis api for javascipt 加载天地图、百度地图
写在前面的话: 1.百度地图是自己定义的坐标系统,wkid=102100.百度地图数据是加密的产物.下文将附上百度坐标与WGS84,谷歌等坐标系统转换方法(地理-地理),此方法并未亲测,据说准 2.百 ...
随机推荐
- Jquery的bootstrap在线文本编辑器插件Summernote
http://www.jqcool.net/demo/201407/bootstrap-summernote/ Summernote是一个基于jquery的bootstrap超级简单WYSIWYG在线 ...
- Poj1741-Tree(树分治)
题意:找树上有多少对距离小于K的对数解析:树分治模板题,见注释 代码 #include<cstdio> #include<cstring> #include<string ...
- Java宝典(二)
--String s = "a" + "b" + "c" + "d"; 一共创建了多少个对象? --对于如下代码: St ...
- boost格式化输出xml
我的boost为1.56而不是1.55 boost在xml的例子给出了一段写xml文件的代码,我简化如下: void debug_settings::save(const std::string &a ...
- Python多线程(threading模块)
线程(thread)是操作系统能够进行运算调度的最小单位.它被包含在进程之中,是进程中的实际运作单位.一条线程指的是进程中一个单一顺序的控制流,一个进程中可以并发多个线程,每条线程并行执行不同的任务. ...
- Maxiee的Vim入门日记(4)——安装windows下的Cscope
Maxiee今天又学到了一个插件——Cscope.Cscope 是一款用于查看大型工程中的代码的软件.它使用方便,支持快速查找 C Symbol.function 等在工程中所有出现的位置,而不用自己 ...
- [CSS3] CSS Display Property: Block, Inline-Block, and Inline
Understanding the most common CSS display types of block, inline-block, and inline will allow you to ...
- [跟我学spring学习笔记][DI循环依赖]
循环依赖 什么是循环依赖? 循环依赖就是循环引用,就是两个或多个Bean相互之间的持有对方. Spring容器循环依赖包括构造器循环依赖和setter循环依赖,那Spring容器如何解决循环依赖呢? ...
- SQL Server事务的存储过程
在酒店管理系统开发中,我们会创建房间表和房间类型表(房型表)这两个表,如下图所示: 房型表:RoomType 房间表:Room 首先这两个表的关系:Room是从表,RoomType是主表,两表有主外键 ...
- asp.net缓存(一)
ASP.NET页面输出缓存(OutputCache) 页面输出缓存是最为简单的缓存机制,该机制将整个ASP.NET页面内容保存在服务器内存中.当用户请求该页面时,系统从内存中输出相关数据,直到缓存数据 ...