1. 发布wms服务需要注意,
配置好mxd文档后,发布地图服务前,在server目录里建立文件夹,将要发布的wms服务发布在文件夹里。
开始在做的时候,没有加文件夹,android api 在addlayer 时候,一直提示错误。
com.esri.core.io.EsriSecurityException: EsriSecurityException[code = -10001 msg = User credentials were invalid. Please supply a valid username and password in order to access the secure service.
如果遇到这个错误,可以添加文件夹试一下。
建立服务时候,勾选上wms能力。
2. wms 服务地址
相应的wms地址为 http://192.9.200.209:8399/arcgis/services
/wmsfolder/wmstest/MapServer/WMSServer
其中红色字体为需要更改为文件夹和服务的名称
3. 叠加图层
WMSLayer wmsLayer =
new
WMSLayer(
“http://192.9.200.209:8399/arcgis/services/wmsfolder/wmstest/MapServer/WMSServer”
,SpatialReference.create (4214));
mMapView
.addLayer(wmsLayer);