ArcGIS Web API 接入E都市瓦片

0
分享 2013-08-16
接入E都市也类似于google的瓦片,只是空间参考可控制性不强,但是E都市本身也不是用的常规空间参考,所以这样接进来不影响看得效果就可以了。
publicclassEdushi :TiledMapServiceLayer
{
publicoverridevoid Initialize()
{
this.FullExtent = new ESRI.ArcGIS.Client.Geometry.Envelope(-20037508.342787, -20037508.342787, 20037508.342787, 20037508.342787);
{
SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100);
};
this.SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100);
this.TileInfo = new TileInfo()
{
Height = 256,
Width = 256,

Origin = new ESRI.ArcGIS.Client.Geometry.MapPoint(-20037508.342787, 20037508.342787)
{
SpatialReference = new ESRI.ArcGIS.Client.Geometry.SpatialReference(102100)
},
Lods = new Lod[4]
};
double resolution = 9783.93962049996/4;
for (int i = 0; i <TileInfo.Lods.Length; i++)
{
TileInfo.Lods = new Lod() { Resolution = resolution };
resolution /= 2;
}
base.Initialize();
}
publicoverridestring GetTileUrl(int level, int row, int col)
{
string url = null;
if (level == 0)
{
url = “http://cpic2.edushi.com/cn/che ... c/png” + (3 – level) + “/” + (col – 25) + “,” + (row – 25) + “.png”;
}
if (level == 1)
{
url = “http://cpic2.edushi.com/cn/che ... c/png” + (3 – level) + “/” + (col – 50) + “,” + (row – 50) + “.png”;
}
if (level == 2)
{
url = “http://cpic2.edushi.com/cn/che ... c/png” + (3 – level) + “/” + (col – 100) + “,” + (row – 100) + “.png”;
}
if (level == 3)
{
url = “http://cpic2.edushi.com/cn/che ... c/png” + (3 – level) + “/” + (col – 200) + “,” + (row – 200) + “.png”;
}
return url;
}
}

文章来源:http://blog.csdn.net/sydbc/article/details/17258061

0 个评论

要回复文章请先登录注册