我正在使用带有新加坡 OneMap 服务器的 ESRI Android SDK 作为底图。当我启动地图的定位服务时,由于无效的 SpatialReference,精度圈导致异常。
Could not update the active symbol
java.lang.RuntimeException: Invalid SpatialReference.
at com.esri.core.geometry.SpatialReference.nativeGetUnit(Native Method)
at com.esri.core.geometry.SpatialReference.getUnit(Unknown Source)
at com.esri.android.map.LocationService$a.k(Unknown Source)
at com.esri.android.map.LocationService$a$a.onLocationChanged(Unknown Source)
我的代码如下
map = (MapView) view.findViewById(R.id.map);
basemap = new ArcGISTiledMapServiceLayer
("http://e1.onemap.sg/arcgis/rest/services/SM128/MapServer");
map.addLayer(basemap);
map.setOnStatusChangedListener(new OnStatusChangedListener()
{
private static final long serialVersionUID = 1L;
@Override
public void onStatusChanged(Object source, STATUS status) {
if (OnStatusChangedListener.STATUS.INITIALIZED ==
status && source == map)
{
//Start location service
LocationService ls = map.getLocationService();
ls.setLocationListener(new LocationListener(){
@Override
public void onLocationChanged(Location location) {
// Do something
}
@Override
public void onProviderDisabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onProviderEnabled(String provider) {
// TODO Auto-generated method stub
}
@Override
public void onStatusChanged(String provider,
int status, Bundle extras) {
// TODO Auto-generated method stub
}
});
ls.start();
}
}
禁用精度圈时不会发生此问题,但在我的情况下,我需要启用它。
任何帮助将非常感激。