val red = 0
val green = 0
val blue = 0
//将屏幕坐标转成地图坐标
val Pixelpoint2D = mMapControl!!.map.pixelToMap(pixelPoint)
mMapControl!!.map.layers.get(0).isEditable = true
val datasetVector = mMapControl!!.map.layers.get(0).dataset as DatasetVector
val recordset = datasetVector.getRecordset(false, CursorType.DYNAMIC)
recordset.moveFirst()
//设置风格
val geoText = GeoText()
val textPart = TextPart()
textPart.text = mLabeltext //设置内容
textPart.anchorPoint = Pixelpoint2D //设置瞄点
val textStyle = TextStyle()
textStyle.foreColor = Color(red, green, blue) //设置前景色
geoText.addPart(textPart)
geoText.textStyle = textStyle
recordset.addNew(geoText)
recordset.update() //更新记录
textPart.dispose()
geoText.dispose()
recordset.close()
recordset.dispose()
mMapControl!!.map.refresh()
如题,通过如上代码进行文字标注,发现无法进行标注显示,经测试发现是图层不支持编辑属性,通过设置编辑属性为true还是无法进行文字标注,请问如何在没有编辑图层的情况下添加文字标注,创建编辑图层的规范流程是怎么样的?