Here is my code, the problem now is that if the shp originally has Feature in it it will show up properly, but if the shp is empty it won't show up and has to be restarted.
shapefileFeatureTable.load().onSuccess {
val feature =
shapefileFeatureTable.createFeature(attr, lastPatchSurfaceGraphic!!.geometry)
shapefileFeatureTable.addFeature(feature).onSuccess {
val featureLayer = FeatureLayer.createWithFeatureTable(shapefileFeatureTable)
if (patchType == 1) {
featureLayer.renderer = Config.defaultPointerRender
} else {
featureLayer.renderer = Config.defaultPatchRender
}
map!!.operationalLayers.add(featureLayer)
}.onFailure {
it.printStackTrace()
ToastUtils.show("添加失败,${it.message}")
}
}