1.首先确保自己的手机上文件路径正确,必须包含(.shp,.shx,.dbf三个文件,放在同一文件夹下)当然,如果加载了底图的话,最好要有投影坐标系文件.prj。
2. 读取shp文件,方法参照(Arcgis for Android之前的配置等工作好多大神写过了的,可以看看他们的系列)
https://blog.youkuaiyun.com/qq_36699930/article/details/82498704
https://blog.youkuaiyun.com/Smart3S/article/details/81138051
主要就是那一句 shapefileTable = new ShapefileFeatureTable(你自己的shp路径);
//示例
public void showShapefile() {
String mappath = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Map/xzq.shp";
//这一句就读取了!!注意,测试用的shp文件放在Map文件夹下的,按照自己放的位置改路径。
shapefileTable = new ShapefileFeatureTable(mappath);
shapefileTable.loadAsync();
shapefileTable.addDoneLoadingListener(()-> {
shapefileLayer = new FeatureLayer(shapefileTab