优化UI
This commit is contained in:
parent
54b30d5db5
commit
00e197f264
@ -158,13 +158,19 @@ class OfflineMapDownloadScope(
|
|||||||
val res =
|
val res =
|
||||||
fileTemp.renameTo(File("${Constant.OFFLINE_MAP_PATH}${cityBean.fileName}"))
|
fileTemp.renameTo(File("${Constant.OFFLINE_MAP_PATH}${cityBean.fileName}"))
|
||||||
change(FileDownloadStatus.DONE)
|
change(FileDownloadStatus.DONE)
|
||||||
|
try {
|
||||||
withContext(Dispatchers.Main) {
|
withContext(Dispatchers.Main) {
|
||||||
downloadManager.mapController.layerManagerHandler.loadBaseMap()
|
downloadManager.mapController.layerManagerHandler.loadBaseMap()
|
||||||
}
|
}
|
||||||
|
}catch (e:Throwable){
|
||||||
|
Log.e("jingo", "下载离线地图 load map ${e.message}")
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
change(FileDownloadStatus.PAUSE)
|
change(FileDownloadStatus.PAUSE)
|
||||||
}
|
}
|
||||||
} catch (e: Throwable) {
|
} catch (e: Throwable) {
|
||||||
|
Log.e("jingo", "下载离线地图 ${e.message}")
|
||||||
change(FileDownloadStatus.ERROR)
|
change(FileDownloadStatus.ERROR)
|
||||||
} finally {
|
} finally {
|
||||||
inputStream?.close()
|
inputStream?.close()
|
||||||
|
@ -941,9 +941,12 @@ class MainActivity : BaseActivity() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 打开底部导航栏
|
||||||
|
*/
|
||||||
private fun showMainActivityBottomSheetGroup() {
|
private fun showMainActivityBottomSheetGroup() {
|
||||||
binding.mainActivityBottomSheetGroup.visibility = View.VISIBLE
|
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(
|
mapController.mMapView.vtmMap.animator().animateTo(
|
||||||
GeoPoint(
|
GeoPoint(
|
||||||
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
||||||
@ -951,10 +954,12 @@ class MainActivity : BaseActivity() {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 关闭底部导航栏
|
||||||
|
*/
|
||||||
private fun hideMainActivityBottomSheetGroup() {
|
private fun hideMainActivityBottomSheetGroup() {
|
||||||
binding.mainActivityBottomSheetGroup.visibility = View.GONE
|
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(
|
mapController.mMapView.vtmMap.animator().animateTo(
|
||||||
GeoPoint(
|
GeoPoint(
|
||||||
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
mapController.mMapView.vtmMap.mapPosition.geoPoint.latitude,
|
||||||
|
@ -262,7 +262,7 @@ public final class NIMapView extends RelativeLayout {
|
|||||||
|
|
||||||
// 增加比例尺图层
|
// 增加比例尺图层
|
||||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
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) {
|
// if (gridLayer == null) {
|
||||||
// gridLayer = new TileGridLayer(getVtmMap());
|
// gridLayer = new TileGridLayer(getVtmMap());
|
||||||
@ -898,7 +898,7 @@ public final class NIMapView extends RelativeLayout {
|
|||||||
mapScaleBarLayer = null;
|
mapScaleBarLayer = null;
|
||||||
}
|
}
|
||||||
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
NaviMapScaleBar naviMapScaleBar = new NaviMapScaleBar(getVtmMap());
|
||||||
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_CENTER, xOffset, yOffset);
|
mapScaleBarLayer = naviMapScaleBar.initScaleBarLayer(GLViewport.Position.BOTTOM_LEFT, xOffset, yOffset);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -36,7 +36,6 @@ public class OMDBReferenceDataSource implements ITileDataSource {
|
|||||||
int xEnd = (int) ((tile.tileX + 1) << m);
|
int xEnd = (int) ((tile.tileX + 1) << m);
|
||||||
int yStart = (int) tile.tileY << m;
|
int yStart = (int) tile.tileY << m;
|
||||||
int yEnd = (int) ((tile.tileY + 1) << 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)
|
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");
|
.rawPredicate("taskId=" + Constant.TASK_ID + " and tileX>=" + xStart + " and tileX<=" + xEnd + " and tileY>=" + yStart + " and tileY<=" + yEnd + " and enable>=1");
|
||||||
// 筛选不显示的数据
|
// 筛选不显示的数据
|
||||||
|
@ -38,7 +38,6 @@ public class OMDBTileDataSource implements ITileDataSource {
|
|||||||
int xEnd = (int) ((tile.tileX + 1) << m);
|
int xEnd = (int) ((tile.tileX + 1) << m);
|
||||||
int yStart = (int) tile.tileY << m;
|
int yStart = (int) tile.tileY << m;
|
||||||
int yEnd = (int) ((tile.tileY + 1) << 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");
|
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) {
|
if (Constant.HAD_LAYER_INVISIABLE_ARRAY != null && Constant.HAD_LAYER_INVISIABLE_ARRAY.length > 0) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user