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