我曾与下面的代码试图读取和显示shape文件从我的SD卡如何在Android中使用形状文件显示地图?
ShapefileFeatureTable shapefileFeatureTable = null;
try {
shapefileFeatureTable = new ShapefileFeatureTable(Environment.getExternalStorageDirectory().getAbsolutePath()+"/India_SHP/INDIA.shp");
featureLayer = new FeatureLayer(shapefileFeatureTable);
featureLayer.setRenderer(new SimpleRenderer(new SimpleMarkerSymbol(
getResources().getColor(android.R.color.holo_blue_bright),
28, SimpleMarkerSymbol.STYLE.CIRCLE)));
mMapView.addLayer(featureLayer);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
这里是我的应用程序的build.gradle文件的详细信息
dependencies {
repositories {
jcenter()
// Add the Esri public Bintray Maven repository
maven {
url 'https://esri.bintray.com/arcgis'
}
}
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.1'
testCompile 'junit:junit:4.12'
compile 'com.esri.arcgis.android:arcgis-android:10.2.5'
}
最后我正在变空黑色屏幕
任何人都可以帮我解决这个问题吗?我想最后我发现用Openmap库
这里的答案从过去三天
尝试寻找这个:http://gis.stackexchange.com/questions/48191/how-to-display-esri-shapefile-in-android –