Merge branch 'master' of gitlab.navinfo.com:CollectVehicle/OneMapQS

This commit is contained in:
squallzhjch 2023-07-27 11:16:49 +08:00
commit b9e3e4766e
7 changed files with 78 additions and 63 deletions

View File

@ -4,43 +4,43 @@
"table": "OMDB_CHECKPOINT",
"code": 1012,
"name": "检查点",
"zoomMin": 18,
"zoomMax": 23
"zoomMin": 16,
"zoomMax": 19
},
"2001": {
"table": "OMDB_RD_LINK",
"code": 2001,
"name": "道路线",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2002": {
"table": "OMDB_RD_LINK_FUNCTION_CLASS",
"code": 2002,
"name": "道路功能等级",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2008": {
"table": "OMDB_RD_LINK_KIND",
"code": 2008,
"name": "道路种别",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2010": {
"table": "OMDB_LINK_DIRECT",
"code": 2010,
"name": "道路方向",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2011": {
"table": "OMDB_LINK_NAME",
"code": 2011,
"name": "道路名",
"zoomMin": 18,
"zoomMax": 19,
"zoomMin": 16,
"zoomMax": 17,
"transformer": [
{
"k": "geometry",
@ -54,8 +54,8 @@
"table": "OMDB_LANE_MARK_BOUNDARYTYPE",
"code": 2013,
"name": "车道边界类型",
"zoomMin": 20,
"zoomMax": 23,
"zoomMin": 18,
"zoomMax": 21,
"transformer": [
{
"k": "geometry",
@ -69,22 +69,22 @@
"table": "OMDB_LINK_SPEEDLIMIT",
"code": 2019,
"name": "常规线限速",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2020": {
"table": "OMDB_LINK_SPEEDLIMIT_COND",
"code": 2020,
"name": "条件线限速",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2021": {
"table": "OMDB_LINK_SPEEDLIMIT_VAR",
"code": 2021,
"name": "可变线限速",
"zoomMin": 18,
"zoomMax": 19
"zoomMin": 16,
"zoomMax": 17
},
"2022": {
"table": "OMDB_CON_ACCESS",
@ -110,8 +110,8 @@
"table": "OMDB_RDBOUND_BOUNDARYTYPE",
"code": 2083,
"name": "道路边界类型",
"zoomMin": 20,
"zoomMax": 23
"zoomMin": 18,
"zoomMax": 21
},
"2201":{
"table": "OMDB_BRIDGE",
@ -122,8 +122,8 @@
"table": "OMDB_TUNNEL",
"code": 2202,
"name": "隧道",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "geometry",
@ -137,8 +137,8 @@
"table": "OMDB_INTERSECTION",
"code": 4001,
"name": "路口",
"zoomMin": 18,
"zoomMax": 19,
"zoomMin": 16,
"zoomMax": 17,
"transformer": [
{
"k": "geometry",
@ -152,8 +152,8 @@
"table": "OMDB_SPEEDLIMIT",
"code": 4002,
"name": "常规点限速",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "maxSpeed",
@ -173,8 +173,8 @@
"table": "OMDB_SPEEDLIMIT_COND",
"code": 4003,
"name": "条件点限速",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "maxSpeed",
@ -188,8 +188,8 @@
"table": "OMDB_SPEEDLIMIT_VAR",
"code": 4004,
"name": "可变点限速",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "location",
@ -215,8 +215,8 @@
"table": "OMDB_RESTRICTION",
"code": 4006,
"name": "普通交限",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "geometry",
@ -254,8 +254,8 @@
"table": "OMDB_ELECTRONICEYE",
"code": 4010,
"name": "电子眼",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
{
"k": "geometry",
@ -287,8 +287,8 @@
"table": "OMDB_TRAFFICLIGHT",
"code": 4022,
"name": "交通灯",
"zoomMin": 18,
"zoomMax": 23,
"zoomMin": 16,
"zoomMax": 21,
"transformer": [
]
},
@ -296,8 +296,8 @@
"table": "OMDB_LANEINFO",
"code": 4601,
"name": "车信",
"zoomMin": 18,
"zoomMax": 19,
"zoomMin": 16,
"zoomMax": 17,
"transformer": [
{
"k": "geometry",
@ -323,8 +323,8 @@
"table": "OMDB_LANE_LINK_LG",
"code": 5001,
"name": "车道中心线",
"zoomMin": 20,
"zoomMax": 23,
"zoomMin": 18,
"zoomMax": 21,
"transformer": [
{
"k": "geometry",

View File

@ -115,8 +115,8 @@ class ImportConfig {
class TableInfo {
val table: String = ""
val code: Int = 0
val zoomMin: Int = 18
val zoomMax: Int = 23
val zoomMin: Int = 16
val zoomMax: Int = 21
val name: String = ""
var checked : Boolean = true
var transformer: MutableList<Transform> = mutableListOf()

View File

@ -190,6 +190,8 @@ class MainViewModel @Inject constructor(
private var disTime: Long = 1000
private var currentMapZoomLevel: Int = 0
init {
mapController.mMapView.vtmMap.events.bind(Map.UpdateListener { e, mapPosition ->
@ -197,8 +199,13 @@ class MainViewModel @Inject constructor(
Map.SCALE_EVENT, Map.MOVE_EVENT, Map.ROTATE_EVENT -> liveDataCenterPoint.value =
mapPosition
}
if(mapController.mMapView.vtmMap.mapPosition.zoomLevel>=16){
}
currentMapZoomLevel = mapController.mMapView.vtmMap.mapPosition.zoomLevel
})
currentMapZoomLevel = mapController.mMapView.vtmMap.mapPosition.zoomLevel
shareUtil = ShareUtil(mapController.mMapView.context, 1)

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<rendertheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" map-background="#f4f4f4"
<rendertheme xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" map-background="#bfbfbf"
version="1" xmlns="http://opensciencemap.org/rendertheme" xsi:schemaLocation="http://opensciencemap.org/rendertheme
https://raw.githubusercontent.com/mapsforge/vtm/master/resources/rendertheme.xsd">
@ -1486,18 +1486,18 @@
</m>
<!-- 道路线 -->
<m v="OMDB_RD_LINK" zoom-max="19">
<m v="OMDB_RD_LINK">
<line stroke="#9c9c9c" width="1" />
</m>
<!-- 检查点 -->
<m v="OMDB_CHECKPOINT" zoom-max="19">
<m v="OMDB_CHECKPOINT">
<symbol src="assets:omdb/icon_1012_0.svg" symbol-height="64"
symbol-width="64"></symbol>
</m>
<!--道路种别-->
<m v="OMDB_RD_LINK_KIND" zoom-max="19">
<m v="OMDB_RD_LINK_KIND">
<outline-layer id="kind0" stroke="#44000000" width="0.1" />
<outline-layer id="kind1" stroke="#aa807040" width="0.1" />
<m k="kind" v="1">
@ -1530,7 +1530,7 @@
</m>
<!--常规点限速-->
<m v="OMDB_SPEEDLIMIT" zoom-max="19">
<m v="OMDB_SPEEDLIMIT">
<m k="speedFlag" v="0">
<caption fill="#000000" k="maxSpeed" priority="0" size="12" stroke="#ffffff"
stroke-width="1.0"></caption>
@ -1562,7 +1562,7 @@
</m>
<!--可变点限速-->
<m v="OMDB_SPEEDLIMIT_VAR" zoom-max="19">
<m v="OMDB_SPEEDLIMIT_VAR" >
<m k="speedFlag" v="0">
<caption fill="#000000" k="maxSpeed" priority="0" size="12" stroke="#ffffff"
stroke-width="1.0"></caption>
@ -1578,14 +1578,14 @@
</m>
<!--车道中心线-->
<m v="OMDB_LANE_LINK_LG" zoom-min="20">
<m v="OMDB_LANE_LINK_LG">
<m k="width" v="~">
<line stroke="#7A88A0" width="5" />
</m>
</m>0
<!-- 道路边界类型 -->
<m v="OMDB_RDBOUND_BOUNDARYTYPE" zoom-min="20">
<m v="OMDB_RDBOUND_BOUNDARYTYPE">
<outline-layer id="boundaryType" stroke="#8e44ad" width="0.1" />
<m k="boundaryType" v="0|2|3|4|5|6|7|8|9">
<line stroke="#ffffff" use="boundaryType" width="0.1"/>
@ -1597,7 +1597,7 @@
</m>
<!-- 车道边界类型 -->
<m v="OMDB_LANE_MARK_BOUNDARYTYPE" zoom-min="20">
<m v="OMDB_LANE_MARK_BOUNDARYTYPE">
<outline-layer id="boundary" stroke="#ffffff" width="0.1" />
<m k="boundaryType" v="2">
<!--标线-->
@ -1660,7 +1660,7 @@
</m>
<!--隧道-->
<m v="OMDB_TUNNEL" zoom-max="19">
<m v="OMDB_TUNNEL">
<m k="formOfWay">
<line dasharray="0.2,0.2" stroke="#d4237a" width="0.2" />
</m>
@ -1687,13 +1687,13 @@
</m>
<!--交通灯-->
<m v="OMDB_TRAFFICLIGHT" zoom-max="19">
<m v="OMDB_TRAFFICLIGHT">
<symbol repeat="false" rotate="false" src="assets:omdb/icon_4022_0.svg"
symbol-height="69" symbol-width="69"></symbol>
</m>
<!--普通交限-->
<m v="OMDB_RESTRICTION" zoom-max="19">
<m v="OMDB_RESTRICTION">
<m k="angle">
<symbol repeat="false" repeat-start="0" rotate="false"
src="assets:omdb/icon_4006_0.svg" symbol-height="69" symbol-width="69"></symbol>
@ -1709,7 +1709,7 @@
</m>
<!--电子眼-->
<m v="OMDB_ELECTRONICEYE" zoom-max="19">
<m v="OMDB_ELECTRONICEYE">
<caption dy="-30" fill="#000000" k="name" priority="0" size="14"
stroke="#ffffff" stroke-width="1.0"></caption>
<m k="type" v="angle">
@ -1722,7 +1722,7 @@
</m>
<!-- 路口 -->
<m v="OMDB_INTERSECTION" zoom-max="19">
<m v="OMDB_INTERSECTION">
<m k="type" v="node">
<symbol src="assets:symbols/dot_blue_dark.svg"></symbol>
</m>
@ -1737,7 +1737,7 @@
</m>
<!-- 车信 -->
<m v="OMDB_LANEINFO" zoom-max="19">
<m v="OMDB_LANEINFO" >
<m k="currentType" v="0">
<m k="currentDirect" v="1">
<symbol repeat="false" repeat-start="0" repeat-gap="2000"

View File

@ -64,7 +64,7 @@ public class OMDBDataDecoder extends TileDecoder {
}
@RequiresApi(api = Build.VERSION_CODES.N)
public boolean decode(int zoomLevel,Tile tile, ITileDataSink sink, List<RenderEntity> listResult) {
public boolean decode(int mapLevel,Tile tile, ITileDataSink sink, List<RenderEntity> listResult) {
mTileDataSink = sink;
mTileScale = 1 << tile.zoomLevel;
mTileX = tile.tileX / mTileScale;
@ -74,10 +74,12 @@ public class OMDBDataDecoder extends TileDecoder {
listResult.stream().iterator().forEachRemaining(new Consumer<RenderEntity>() {
@Override
public void accept(RenderEntity renderEntity) {
if(zoomLevel>=renderEntity.getZoomMin()&&zoomLevel<=renderEntity.getZoomMax()){
if(!(mapLevel<renderEntity.getZoomMin()||mapLevel>renderEntity.getZoomMax())){
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
properties.putAll(renderEntity.getProperties());
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);
}else{
Log.e("qj","render"+renderEntity.name+"=="+renderEntity.getZoomMin()+"==="+renderEntity.getZoomMax());
}
}
});
@ -188,4 +190,10 @@ public class OMDBDataDecoder extends TileDecoder {
if (!hasName && fallbackName != null)
mMapElement.tags.add(new Tag(Tag.KEY_NAME, fallbackName, false));
}
public void clean(){
if(mTileDataSink!=null){
mTileDataSink.notifyAll();
}
}
}

View File

@ -70,7 +70,7 @@ public class OMDBReferenceDecoder extends TileDecoder {
listResult.stream().iterator().forEachRemaining(new Consumer<ReferenceEntity>() {
@Override
public void accept(ReferenceEntity renderEntity) {
if(mapLevel>=renderEntity.getZoomMin()&&mapLevel<=renderEntity.getZoomMax()){
if(!(mapLevel<renderEntity.getZoomMin()||mapLevel>renderEntity.getZoomMax())){
Map<String, Object> properties= new HashMap<>(renderEntity.getProperties().size());
properties.putAll(renderEntity.getProperties());
parseGeometry(renderEntity.getTable(), renderEntity.getWkt(), properties);

View File

@ -31,7 +31,7 @@ public class Constant {
public static String[] HAD_LAYER_INVISIABLE_ARRAY;
public static final int OVER_ZOOM = 21;
public static final int MAX_ZOOM = 23;
public static final int OMDB_MIN_ZOOM = 18;
public static final int OMDB_MIN_ZOOM = 16;
/**
* 服务器地址