增加要素捕捉功能,
增加测量功能
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
package com.navinfo.collect.library.data.entity
|
||||
|
||||
import com.navinfo.collect.library.system.Constant
|
||||
import com.navinfo.collect.library.utils.GeometryTools
|
||||
import com.navinfo.collect.library.utils.GeometryToolsKt
|
||||
import io.realm.RealmDictionary
|
||||
@@ -8,9 +7,7 @@ import io.realm.RealmObject
|
||||
import io.realm.RealmSet
|
||||
import io.realm.annotations.Ignore
|
||||
import io.realm.annotations.PrimaryKey
|
||||
import org.locationtech.jts.geom.Coordinate
|
||||
import org.locationtech.jts.geom.Geometry
|
||||
import org.oscim.core.MercatorProjection
|
||||
import java.util.*
|
||||
|
||||
/**
|
||||
|
||||
@@ -218,11 +218,11 @@ class LayerManagerHandler(context: AppCompatActivity, mapView: NIMapView, traceP
|
||||
labelNiLocationLayer.isEnabled = false
|
||||
}
|
||||
|
||||
fun omdbLayersUpdate(){
|
||||
// omdbVectorTileLayer
|
||||
fun omdbLayersClear(){
|
||||
// omdbVectorTileLayer.
|
||||
// omdbReferenceTileLayer.
|
||||
omdbLabelLayer.update()
|
||||
omdbReferenceLabelLayer.update()
|
||||
omdbLabelLayer.clearLabels()
|
||||
omdbReferenceLabelLayer.clearLabels()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package com.navinfo.collect.library.map.source;
|
||||
|
||||
import android.os.Build;
|
||||
import android.util.Log;
|
||||
|
||||
import androidx.annotation.RequiresApi;
|
||||
|
||||
@@ -29,27 +30,28 @@ public class OMDBReferenceDataSource implements ITileDataSource {
|
||||
@Override
|
||||
public void query(MapTile tile, ITileDataSink mapDataSink) {
|
||||
// 获取tile对应的坐标范围
|
||||
if (tile.zoomLevel>=Constant.OMDB_MIN_ZOOM&&tile.zoomLevel<=Constant.OVER_ZOOM) {
|
||||
int m = Constant.OVER_ZOOM-tile.zoomLevel;
|
||||
int xStart = (int)tile.tileX<<m;
|
||||
int xEnd = (int)((tile.tileX+1)<<m);
|
||||
int yStart = (int)tile.tileY<<m;
|
||||
int yEnd = (int)((tile.tileY+1)<<m);
|
||||
|
||||
if (tile.zoomLevel >= Constant.OMDB_MIN_ZOOM && tile.zoomLevel <= Constant.OVER_ZOOM) {
|
||||
int m = Constant.OVER_ZOOM - tile.zoomLevel;
|
||||
int xStart = (int) tile.tileX << m;
|
||||
int xEnd = (int) ((tile.tileX + 1) << m);
|
||||
int yStart = (int) tile.tileY << m;
|
||||
int yEnd = (int) ((tile.tileY + 1) << m);
|
||||
Log.e("jingo", Constant.TASK_ID + " " + xStart + " " + xEnd + " " + yStart + " " + yEnd);
|
||||
RealmQuery<ReferenceEntity> realmQuery = Realm.getDefaultInstance().where(ReferenceEntity.class)
|
||||
.rawPredicate("tileX>="+xStart+" and tileX<="+xEnd+" and tileY>="+yStart+" and tileY<="+yEnd);
|
||||
.rawPredicate("taskId=" + Constant.TASK_ID + " and tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd);
|
||||
// 筛选不显示的数据
|
||||
if (Constant.HAD_LAYER_INVISIABLE_ARRAY!=null&&Constant.HAD_LAYER_INVISIABLE_ARRAY.length>0) {
|
||||
if (Constant.HAD_LAYER_INVISIABLE_ARRAY != null && Constant.HAD_LAYER_INVISIABLE_ARRAY.length > 0) {
|
||||
realmQuery.beginGroup();
|
||||
for (String type: Constant.HAD_LAYER_INVISIABLE_ARRAY) {
|
||||
for (String type : Constant.HAD_LAYER_INVISIABLE_ARRAY) {
|
||||
realmQuery.notEqualTo("table", type);
|
||||
}
|
||||
realmQuery.endGroup();
|
||||
}
|
||||
List<ReferenceEntity> listResult = realmQuery/*.distinct("id")*/.findAll();
|
||||
if (!listResult.isEmpty()) {
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel,tile, mapDataSink, listResult);
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel, tile, mapDataSink, listResult);
|
||||
}
|
||||
Log.e("jingo",listResult.size() + "条数据");
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
|
||||
@@ -38,8 +38,8 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
int xEnd = (int) ((tile.tileX + 1) << m);
|
||||
int yStart = (int) tile.tileY << m;
|
||||
int yEnd = (int) ((tile.tileY + 1) << m);
|
||||
|
||||
RealmQuery<RenderEntity> realmQuery = Realm.getDefaultInstance().where(RenderEntity.class).rawPredicate("tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd);
|
||||
Log.e("jingo", Constant.TASK_ID + " " + xStart + " " + xEnd + " " + yStart + " " + yEnd);
|
||||
RealmQuery<RenderEntity> realmQuery = Realm.getDefaultInstance().where(RenderEntity.class).rawPredicate("taskId=" + Constant.TASK_ID + " and tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd);
|
||||
// 筛选不显示的数据
|
||||
if (Constant.HAD_LAYER_INVISIABLE_ARRAY != null && Constant.HAD_LAYER_INVISIABLE_ARRAY.length > 0) {
|
||||
realmQuery.beginGroup();
|
||||
@@ -50,9 +50,10 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
}
|
||||
List<RenderEntity> listResult = realmQuery/*.distinct("id")*/.findAll();
|
||||
if (!listResult.isEmpty()) {
|
||||
Log.e("qj","查询数据=="+listResult.size()+"==地图级别"+tile.zoomLevel);
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel,tile, mapDataSink, listResult);
|
||||
Log.e("qj", "查询数据==" + listResult.size() + "==地图级别" + tile.zoomLevel);
|
||||
mThreadLocalDecoders.get().decode(tile.zoomLevel, tile, mapDataSink, listResult);
|
||||
}
|
||||
Log.e("jingo",listResult.size() + "条数据 主");
|
||||
mapDataSink.completed(QueryResult.SUCCESS);
|
||||
// Log.d("RealmDBTileDataSource", "tile:"+tile.getBoundingBox().toString());
|
||||
} else {
|
||||
|
||||
@@ -41,7 +41,7 @@ public class RealmDBTileDataSource implements ITileDataSource {
|
||||
int yStart = (int)tile.tileY<<m;
|
||||
int yEnd = (int)((tile.tileY+1)<<m);
|
||||
|
||||
RealmQuery<GeometryFeatureEntity> realmQuery = Realm.getInstance(RealmUtils.getInstance().getRealmConfiguration()).where(GeometryFeatureEntity.class)
|
||||
RealmQuery<GeometryFeatureEntity> realmQuery = Realm.getDefaultInstance().where(GeometryFeatureEntity.class)
|
||||
.rawPredicate("tileX>="+xStart+" and tileX<="+xEnd+" and tileY>="+yStart+" and tileY<="+yEnd);
|
||||
// 筛选不显示的数据
|
||||
if (Constant.HAD_LAYER_INVISIABLE_ARRAY!=null&&Constant.HAD_LAYER_INVISIABLE_ARRAY.length>0) {
|
||||
|
||||
@@ -17,10 +17,10 @@ public class Constant {
|
||||
public static String MAP_PATH = Environment.getExternalStorageDirectory() + "/map/";
|
||||
|
||||
public static void setVisibleTypeMap(Map<String, Boolean> visibleTypeMap) {
|
||||
Map<String, Boolean> HD_LAYER_VISIABLE_MAP= new HashMap<>();
|
||||
Map<String, Boolean> HD_LAYER_VISIABLE_MAP = new HashMap<>();
|
||||
// 只记录不显示的类型
|
||||
if (visibleTypeMap!=null&&!visibleTypeMap.isEmpty()) {
|
||||
for (Map.Entry<String, Boolean> e:visibleTypeMap.entrySet()) {
|
||||
if (visibleTypeMap != null && !visibleTypeMap.isEmpty()) {
|
||||
for (Map.Entry<String, Boolean> e : visibleTypeMap.entrySet()) {
|
||||
if (!e.getValue()) {
|
||||
HD_LAYER_VISIABLE_MAP.put(e.getKey(), e.getValue());
|
||||
}
|
||||
@@ -28,11 +28,13 @@ public class Constant {
|
||||
}
|
||||
HAD_LAYER_INVISIABLE_ARRAY = HD_LAYER_VISIABLE_MAP.keySet().toArray(new String[HD_LAYER_VISIABLE_MAP.keySet().size()]);
|
||||
}
|
||||
|
||||
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 = 16;
|
||||
|
||||
public static int TASK_ID = -1;
|
||||
/**
|
||||
* 服务器地址
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user