fix: 修改18级overzoom模式,解决部分情况下渲染出错的问题
This commit is contained in:
parent
b2d7b8af47
commit
ab873e86af
@ -178,7 +178,7 @@ class PersonalCenterFragment(private var indoorDataListener: ((Boolean) -> Unit?
|
||||
// 定位到指定位置
|
||||
niMapController.mMapView.vtmMap.animator()
|
||||
// .animateTo(GeoPoint( 40.05108004733645, 116.29187746293708 ))
|
||||
.animateTo(GeoPoint(40.07245537956604, 116.239638575623))
|
||||
.animateTo(GeoPoint(40.0882756, 116.3033581))
|
||||
}
|
||||
|
||||
R.id.personal_center_menu_open_all_layer -> {
|
||||
|
@ -1,10 +1,7 @@
|
||||
package com.navinfo.collect.library.map.source;
|
||||
|
||||
import com.navinfo.collect.library.system.Constant;
|
||||
|
||||
import org.oscim.map.Viewport;
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.OverzoomTileDataSource;
|
||||
|
||||
public class OMDBReferenceTileSource extends RealmDBTileSource {
|
||||
private OMDBReferenceDataSource omdbReferenceTileSource;
|
||||
@ -18,7 +15,8 @@ public class OMDBReferenceTileSource extends RealmDBTileSource {
|
||||
@Override
|
||||
public ITileDataSource getDataSource() {
|
||||
//return new OverzoomTileDataSource(new OMDBReferenceDataSource(), Constant.OVER_ZOOM);
|
||||
return new OverzoomTileDataSource(omdbReferenceTileSource, Constant.OVER_ZOOM);
|
||||
// return new OverzoomTileDataSource(omdbReferenceTileSource, Constant.OVER_ZOOM);
|
||||
return omdbReferenceTileSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -81,8 +81,8 @@ public class OMDBTileDataSource implements ITileDataSource {
|
||||
// 数据记录的tile号是以正外接tile号列表,此处过滤并未与当前tile相交的数据
|
||||
if (!listResult.isEmpty()) {
|
||||
Polygon tilePolygon = GeometryTools.getTilePolygon(tile);
|
||||
System.out.println("第一条数据的最小x值:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
System.out.println("当前tile的:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
// System.out.println("第一条数据的最小x值:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
// System.out.println("当前tile的:" + listResult.get(0).getTileX().stream().min(Integer::compare).get());
|
||||
listResult = listResult.stream().filter((RenderEntity renderEntity) -> renderEntity.getWkt().intersects(tilePolygon))
|
||||
/*过滤数据,只有最小x(屏幕的最小x或数据的最小x会被渲染,跨Tile的其他数据不再重复渲染)*/
|
||||
// .filter((RenderEntity renderEntity) -> MercatorProjection.longitudeToTileX(viewport.fromScreenPoint(0,0).getLongitude(), (byte) Constant.DATA_ZOOM) == currentTileX || renderEntity.getTileX().stream().min(Integer::compare).get() == currentTileX)
|
||||
|
@ -3,11 +3,9 @@ package com.navinfo.collect.library.map.source;
|
||||
import android.util.Log;
|
||||
|
||||
import com.navinfo.collect.library.data.entity.RenderEntity;
|
||||
import com.navinfo.collect.library.system.Constant;
|
||||
|
||||
import org.oscim.map.Viewport;
|
||||
import org.oscim.tiling.ITileDataSource;
|
||||
import org.oscim.tiling.OverzoomTileDataSource;
|
||||
|
||||
import io.realm.Realm;
|
||||
|
||||
@ -23,7 +21,8 @@ public class OMDBTileSource extends RealmDBTileSource {
|
||||
@Override
|
||||
public ITileDataSource getDataSource() {
|
||||
// return new OverzoomTileDataSource(new OMDBTileDataSource(), Constant.OVER_ZOOM);
|
||||
return new OverzoomTileDataSource(omdbTileDataSource, Constant.OVER_ZOOM);
|
||||
// return new OverzoomTileDataSource(omdbTileDataSource, Constant.OVER_ZOOM);
|
||||
return omdbTileDataSource;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
2
vtm
2
vtm
@ -1 +1 @@
|
||||
Subproject commit 50f7b028e7f3934a8c330ea8a54046d7d368682d
|
||||
Subproject commit 6a6bb9ab5eaf6bb4c05b3110c612c32ef4c6ef3d
|
Loading…
x
Reference in New Issue
Block a user