This commit is contained in:
squallzhjch 2023-08-11 14:28:55 +08:00
parent 54b30d5db5
commit 00e197f264
5 changed files with 18 additions and 9 deletions

View File

@ -158,13 +158,19 @@ class OfflineMapDownloadScope(
val res =
fileTemp.renameTo(File("${Constant.OFFLINE_MAP_PATH}${cityBean.fileName}"))
change(FileDownloadStatus.DONE)
withContext(Dispatchers.Main) {
downloadManager.mapController.layerManagerHandler.loadBaseMap()
try {
withContext(Dispatchers.Main) {
downloadManager.mapController.layerManagerHandler.loadBaseMap()
}
}catch (e:Throwable){
Log.e("jingo", "下载离线地图 load map ${e.message}")
}
} else {
change(FileDownloadStatus.PAUSE)
}
} catch (e: Throwable) {
Log.e("jingo", "下载离线地图 ${e.message}")
change(FileDownloadStatus.ERROR)
} finally {
inputStream?.close()

View File

@ -941,9 +941,12 @@ class MainActivity : BaseActivity() {
}
}
/**
* 打开底部导航栏
*/
private fun showMainActivityBottomSheetGroup() {
binding.mainActivityBottomSheetGroup.visibility = View.VISIBLE
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 65)
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 10, 60)
mapController.mMapView.vtmMap.animator().animateTo(
GeoPoint(
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
@ -951,10 +954,12 @@ class MainActivity : BaseActivity() {
)
)
}
/**
* 关闭底部导航栏
*/
private fun hideMainActivityBottomSheetGroup() {
binding.mainActivityBottomSheetGroup.visibility = View.GONE
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 5)
mapController.mMapView.setScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 10, 0)
mapController.mMapView.vtmMap.animator().animateTo(
GeoPoint(
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,

View File

@ -262,7 +262,7 @@ public final class NIMapView extends RelativeLayout {
// 增加比例尺图层
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, 128, 5);
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, 10, 0);
// if (gridLayer == null) {
// gridLayer = new TileGridLayer(getVtmMap());
@ -898,7 +898,7 @@ public final class NIMapView extends RelativeLayout {
mapScaleBarLayer = null;
}
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, xOffset, yOffset);
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, xOffset, yOffset);
}
/**

View File

@ -36,7 +36,6 @@ public class OMDBReferenceDataSource implements ITileDataSource {
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("taskId=" + Constant.TASK_ID + " and tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd + " and enable>=1");
// 筛选不显示的数据

View File

@ -38,7 +38,6 @@ 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);
Log.e("jingo", Constant.TASK_ID + " " + xStart + " " + xEnd + " " + yStart + " " + yEnd);
RealmQuery<RenderEntity> realmQuery = Realm.getDefaultInstance().where(RenderEntity.class).rawPredicate("tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd + " and enable>=1");
// 筛选不显示的数据
if (Constant.HAD_LAYER_INVISIABLE_ARRAY != null && Constant.HAD_LAYER_INVISIABLE_ARRAY.length > 0) {