fix: 修改杆状物渲染为图标样式
This commit is contained in:
@@ -173,7 +173,7 @@
|
||||
"name": "文字",
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer2Code": ""
|
||||
"transformer": []
|
||||
},
|
||||
"3003":{
|
||||
"table": "OMDB_OBJECT_SYMBOL",
|
||||
@@ -181,7 +181,22 @@
|
||||
"name": "符号",
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer2Code": ""
|
||||
"transformer": []
|
||||
},
|
||||
"3004":{
|
||||
"table": "OMDB_OBJECT_ARROW",
|
||||
"code": 3004,
|
||||
"name": "箭头",
|
||||
"zoomMin": 15,
|
||||
"zoomMax": 20,
|
||||
"transformer": [
|
||||
{
|
||||
"k": "geometry",
|
||||
"v": "~",
|
||||
"klib": "geometry",
|
||||
"vlib": "obtainDynamicSrc('assets:omdb/arrowDirection/','.svg','arrowClass')"
|
||||
}
|
||||
]
|
||||
},
|
||||
"3005":{
|
||||
"table": "OMDB_TRAFFIC_SIGN",
|
||||
|
||||
@@ -610,26 +610,28 @@ class ImportPreProcess {
|
||||
// 获取杆状物的高程数据
|
||||
val geometry = renderEntity.wkt
|
||||
if (geometry != null) {
|
||||
var minHeight = Double.MAX_VALUE
|
||||
var maxHeight = Double.MIN_VALUE
|
||||
for (coordinate in geometry.coordinates) {
|
||||
if (coordinate.z < minHeight) {
|
||||
minHeight = coordinate.z
|
||||
}
|
||||
if (coordinate.z > maxHeight) {
|
||||
maxHeight = coordinate.z
|
||||
}
|
||||
}
|
||||
for (coordinate in geometry.coordinates) {
|
||||
if (coordinate.z == minHeight) {
|
||||
coordinate.z = 0.0
|
||||
}
|
||||
if (coordinate.z == maxHeight) {
|
||||
coordinate.z = 40.0
|
||||
}
|
||||
}
|
||||
renderEntity.geometry =
|
||||
WKTWriter(3).write(GeometryTools.createLineString(geometry.coordinates))
|
||||
// var minHeight = Double.MAX_VALUE
|
||||
// var maxHeight = Double.MIN_VALUE
|
||||
// for (coordinate in geometry.coordinates) {
|
||||
// if (coordinate.z < minHeight) {
|
||||
// minHeight = coordinate.z
|
||||
// }
|
||||
// if (coordinate.z > maxHeight) {
|
||||
// maxHeight = coordinate.z
|
||||
// }
|
||||
// }
|
||||
// for (coordinate in geometry.coordinates) {
|
||||
// if (coordinate.z == minHeight) {
|
||||
// coordinate.z = 0.0
|
||||
// }
|
||||
// if (coordinate.z == maxHeight) {
|
||||
// coordinate.z = 40.0
|
||||
// }
|
||||
// }
|
||||
// renderEntity.geometry =
|
||||
// WKTWriter(3).write(GeometryTools.createLineString(geometry.coordinates))
|
||||
|
||||
renderEntity.geometry = GeometryTools.createGeometry(GeoPoint(geometry.coordinates[0].y, geometry.coordinates[0].x)).toString()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -741,4 +743,12 @@ class ImportPreProcess {
|
||||
Realm.getDefaultInstance().insert(dynamicSrcReference)
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 向当前renderEntity中添加动态属性
|
||||
* */
|
||||
fun obtainDynamicSrc(renderEntity: RenderEntity, prefix: String, suffix: String, codeName: String) {
|
||||
val code = renderEntity.properties[codeName]
|
||||
renderEntity.properties["src"] = "${prefix}${code}${suffix}"
|
||||
}
|
||||
}
|
||||
@@ -129,7 +129,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
// 定位到指定位置
|
||||
niMapController.mMapView.vtmMap.animator()
|
||||
// .animateTo(GeoPoint( 40.05108004733645, 116.29187746293708 ))
|
||||
.animateTo(GeoPoint( 40.503796123773355,115.81649866261817))
|
||||
.animateTo(GeoPoint( 40.50755634913162,115.80235967728436 ))
|
||||
}
|
||||
R.id.personal_center_menu_open_all_layer -> {
|
||||
MapParamUtils.setDataLayerEnum(DataLayerEnum.SHOW_ALL_LAYERS)
|
||||
|
||||
Reference in New Issue
Block a user