I am trying to load a shapefile (not displaying at the moment) using the following:
Hardware: Android rugged tablet running Android 4.2
SDK: ArcGis 10.2.6-2
Shapefile: http://rdw.sandag.org/file_store\District/Tax_Rate_Area.zip
My Layout:
My Code:
private void test4() { String myExternalStorageLocation = null; String myFileLocationPath = null; try { // in onCreate -> mMapView = (MapView) findViewById(R.id.map); // in onCreate -> test4(); // Ad .shp features layer myExternalStorageLocation = System.getenv("SECONDARY_STORAGE"); myFileLocationPath = "/Maps/SanDiego/Tax_Rate_Area/Tax_Rate_Area.shp"; mShapefileFeatureTable = new ShapefileFeatureTable(myExternalStorageLocation + myFileLocationPath); mFeatureLayer = new FeatureLayer(mShapefileFeatureTable); SimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol(Color.MAGENTA); SimpleRenderer simpleRenderer = new SimpleRenderer(simpleFillSymbol); mFeatureLayer.setRenderer(simpleRenderer); mFeatureLayer.setSelectionColor(Color.YELLOW); mFeatureLayer.setMaxScale(0); mFeatureLayer.setMinScale(0); mFeatureLayer.setVisible(true); mMapView.addLayer(mFeatureLayer); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(MainActivity.this, "File not found @: " + myExternalStorageLocation + myFileLocationPath, Toast.LENGTH_SHORT).show(); }}
أكثر...
Hardware: Android rugged tablet running Android 4.2
SDK: ArcGis 10.2.6-2
Shapefile: http://rdw.sandag.org/file_store\District/Tax_Rate_Area.zip
My Layout:
My Code:
private void test4() { String myExternalStorageLocation = null; String myFileLocationPath = null; try { // in onCreate -> mMapView = (MapView) findViewById(R.id.map); // in onCreate -> test4(); // Ad .shp features layer myExternalStorageLocation = System.getenv("SECONDARY_STORAGE"); myFileLocationPath = "/Maps/SanDiego/Tax_Rate_Area/Tax_Rate_Area.shp"; mShapefileFeatureTable = new ShapefileFeatureTable(myExternalStorageLocation + myFileLocationPath); mFeatureLayer = new FeatureLayer(mShapefileFeatureTable); SimpleFillSymbol simpleFillSymbol = new SimpleFillSymbol(Color.MAGENTA); SimpleRenderer simpleRenderer = new SimpleRenderer(simpleFillSymbol); mFeatureLayer.setRenderer(simpleRenderer); mFeatureLayer.setSelectionColor(Color.YELLOW); mFeatureLayer.setMaxScale(0); mFeatureLayer.setMinScale(0); mFeatureLayer.setVisible(true); mMapView.addLayer(mFeatureLayer); } catch (FileNotFoundException e) { // TODO Auto-generated catch block e.printStackTrace(); Toast.makeText(MainActivity.this, "File not found @: " + myExternalStorageLocation + myFileLocationPath, Toast.LENGTH_SHORT).show(); }}
أكثر...