4.12ArcGIS JS API在全球场景加载CGCS2000
前情提要:
4.11API在三维加载wkid4490天地图http://zhihu.esrichina.com.cn/article/3942
1.本文是上一篇文章正文方式1重写BasetileLayer类的方法的沿用,详细解析这一方法技术细节。
2.4.12版本不再支持上一篇文章方式2的简单方式以WebTileLayer加载天地图在Global场景。目前测试是这样,还没有深究原因。
正文:
首先先Po出截图,展示4.12能够直接在Global场景中使用CGCS2000坐标系加载三维并叠加CGCS2000天地图的能力。这是全球场景对CGCS2000坐标系的全面支持。4.11以及之前版本的API全球场景只支持WGS84和web墨卡托坐标系。


关键技术点有
1.扩展BaseTileLayer类。重写getTileUrl、fetchTile等方法。添加subDomains属性

2.实现subDomain,利用天地图子域名从t0-t7随机请求切片。

3.请求切片时需要level+1。var url = this.getTileUrl(level+1, row, col);

4.定义瓦片结构TileInfo。

切片方案的来源是ArcGIS Pro2.4安装目录下D:\Program Files\ArcGIS\Pro\Resources\TilingSchemes\CGCS2000_Geographic_Coordinate_System.xml
5.实例化TdtLayer对象,并作为底图,tk最好用每位开发者自己的。

注意:
1.发布CGCS2000的场景图层,必须使用ArcGIS Pro2.4版本以上、ArcGIS Enterprise10.7.1以上 或 6月份之后的ArcGIS Online。
2.ArcGIS Pro2.4安装目录下的切片方案D:\Program Files\ArcGIS\Pro\Resources\TilingSchemes\CGCS2000_Geographic_Coordinate_System.xml使用这个切片方案创建的缓存地图可以在CGCS2000的全球场景中进行使用。