This commit is contained in:
qiji4215
2023-09-01 14:27:30 +08:00
59 changed files with 907 additions and 54 deletions

View File

@@ -175,7 +175,7 @@
"name": "文字",
"zoomMin": 15,
"zoomMax": 20,
"transformer2Code": ""
"transformer": []
},
"3003":{
"table": "OMDB_OBJECT_SYMBOL",
@@ -183,7 +183,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",

View File

@@ -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}"
}
}

View File

@@ -129,7 +129,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
// 定位到指定位置
niMapController.mMapView.vtmMap.animator()
// .animateTo(GeoPoint( 40.05108004733645, 116.29187746293708 ))
.animateTo(GeoPoint( 40.480633792652746, 115.99816629572948 ))
.animateTo(GeoPoint( 40.50755634913162,115.80235967728436 ))
}
R.id.personal_center_menu_open_all_layer -> {
MapParamUtils.setDataLayerEnum(DataLayerEnum.SHOW_ALL_LAYERS)