关于ArcGis Runtime For Android加载ArcGis导出的shapefile

目的

    通过ShapfileFeatureTable加载本地shapfile数据

###文件位置

已将shp数据(.dbf、.sbn、.sbx、.shp、.shx)存入移动端

图片说明

问题描述

    在实例化ShapefileFeatureTable对象时,显示为null

###调用方法

public void LoadShapFile(String shpPath, ArcGISMap mArcGISMap) {

// 构建ShapefileFeatureTable,引入本地存储的shapefile文件

ShapefileFeatureTable shapefileFeatureTable = new ShapefileFeatureTable(shpPath);

shapefileFeatureTable.loadAsync();

// 构建featureLayerr

mFeatureLayer = new FeatureLayer(shapefileFeatureTable);

// 设置Shapefile文件的渲染方式

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);

mFeatureLayer.setRenderer(renderer);

//设置选中颜色

mFeatureLayer.setSelectionWidth(5);

mFeatureLayer.setSelectionColor(Color.GREEN);

//mMapView.setViewpointGeometryAsync(mFeatureLayer.getFullExtent());

// 添加到地图的业务图层组中

mArcGISMap.getOperationalLayers().add(mFeatureLayer);

}

调试照片

图片说明

请各位大佬指点指点!

回答

https://blog.csdn.net/esrichinacd/article/details/7801443

以上是 关于ArcGis Runtime For Android加载ArcGis导出的shapefile 的全部内容, 来源链接: utcz.com/a/38226.html

回到顶部