shp文件的可视化与编辑
private void showShapefile() { mainMapView = (MapView) findViewById(R.id.mapView); mainMapView.setAttributionTextVisible(false); mainArcGISMap = new ArcGISMap(new Basemap().createImageryWithLabelsVector()); mainMapView.setMap(mainArcGISMap); final ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable( getResources().getString(R.string.shapefile_path) ); shapefileFeatureTable.loadAsync(); shapefileFeatureTable.addDoneLoadingListener(new Runnable() { @Override public void run() { GeometryType gt = shapefileFeatureTable.getGeometryType(); String name = shapefileFeatureTable.getTableName(); String name1 = name; mainShapefileLayer = new FeatureLayer(shapefileFeatureTable); if (mainShapefileLayer.getFullExtent() != null) { mainMapView.setViewpointGeometryAsync(mainShapefileLayer.getFullExtent()); } else { mainShapefileLayer.addDoneLoadingListener(new Runnable() { @Override public void run() { mainMapView.setViewpointGeometryAsync(mainShapefileLayer.getFullExtent()); } }); } mainArcGISMap.getOperationalLayers().add(mainShapefileLayer); startDrawing(); } }); SimpleLineSymbol lineSymbol = new SimpleLineSymbol(SimpleLineSymbol.Style.SOLID, Color.RED, 1.0f); SimpleFillSymbol fillSymbol = new SimpleFillSymbol(SimpleFillSymbol.Style.SOLID, Color.YELLOW, lineSymbol); SimpleRenderer renderer = new SimpleRenderer(fillSymbol); //mainShapefileLayer.setRenderer(renderer); }