问题:
地图的各个图层有没有必要使用统一的坐标系?
服务端定义的Layer必须使用同一种坐标系?
MapView的坐标系是否必须和地图中的图层一致?
我猜测是没有必要的。
关于MapView的官方介绍
spatialReference SpatialReferenceautocast inherited The spatial
reference of the view. This indicates the Projected Coordinate System
or the Geographic Coordinate System used to locate geographic features
in the map. In a SceneView the following supported coordinate systems
are available.The spatial reference can either be set explicitly or automatically
derived from the following:In the case of a SceneView, if the map is a WebScene instance, the
WebScene.initialViewProperties.spatialReference is used.In all other cases, the spatial reference is derived from the first
layer that loads in this order:
- map.basemap.baseLayers
- map.layers
- map.ground.layers
When using an Esri basemap, the default spatial reference is Web Mercator Auxiliary Sphere.
官方说明MapView的的空间引用可以显式指定,也可以继承baseLayers,地图的layers。
如果MapView的坐标系和地图图层的坐标系不同,进行定位时需要转化坐标(转为MapView使用的坐标系对应的坐标值)才能够正确的定位哦。
假设情形:
地图的一个TileLayer使用了一种自定义的坐标系,
‘PROJCS[“CGCS2000_3_Degree_GK_CM_115.75E”,GEOGCS[“GCS_China_Geodetic_Coordinate_System_2000”,DATUM[“D_China_2000”,SPHEROID[“CGCS2000”,6378137.0,298.257222101]],PRIMEM[“Greenwich”,0.0],UNIT[“Degree”,0.0174532925199433]],PROJECTION[“Transverse_Mercator”],PARAMETER[“false_easting”,500000.0],PARAMETER[“false_northing”,0.0],PARAMETER[“central_meridian”,115.75],PARAMETER[“scale_factor”,1.0],PARAMETER[“latitude_of_origin”,0.0],UNIT[“Meter”,1.0]]’
这种坐标系是没有对应的wkid值的。
现在我要创建一个GraphicLayer(默认坐标系为wgs84)并添加一个点,在地图上这个Point能否在正确的位置显示呢?
答案是可以的。实践证明每一个Layer是独立的。