ArcGIS Runtime for Android最新版本支持UNKnown坐标系或自定义坐标系吗

数据格式为SHP
已邀请:

张佳期

赞同来自:

我使用arcgis runtime for android100.10能够支持加载UNKnown坐标系或自定义坐标系。
代码如下:
public class MainActivity extends AppCompatActivity {

private final static String TAG = MainActivity.class.getSimpleName();

private MapView mMapView;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

// create a new map to display in the map view with a streets basemap
mMapView = findViewById(R.id.mapView);
ArcGISMap map = new ArcGISMap();
mMapView.setMap(map);

// load the shapefile with a local path
ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable(
getExternalFilesDir(null) + getString(R.string.shapefile_path));

// create a feature layer to display the shapefile
FeatureLayer shapefileFeatureLayer = new FeatureLayer(shapefileFeatureTable);
// add the feature layer to the map
mMapView.getMap().getOperationalLayers().add(shapefileFeatureLayer);

shapefileFeatureTable.addDoneLoadingListener(() -> {
if (shapefileFeatureTable.getLoadStatus() == LoadStatus.LOADED) {
// zoom the map to the extent of the shapefile
mMapView.setViewpointAsync(new Viewpoint(shapefileFeatureLayer.getFullExtent()));
} else {
String error = "Shapefile feature table failed to load: " + shapefileFeatureTable.getLoadError().toString();
Toast.makeText(MainActivity.this, error, Toast.LENGTH_LONG).show();
Log.e(TAG, error);
}
});
}

@Override
protected void onPause() {
super.onPause();
mMapView.pause();
}

@Override
protected void onResume() {
super.onResume();
mMapView.resume();
}

@Override
protected void onDestroy() {
super.onDestroy();
mMapView.dispose();
}
}

要回复问题请先登录注册