diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6a982c0..25931cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -131,7 +131,7 @@ overlayGraphics; private ListenableList graphicsOverlays; private GraphicsOverlay mGraphicsOverlay; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -91,7 +93,7 @@ caseType = getIntent().getStringExtra("type"); gson = new Gson(); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(1000);//数字越大,放大比例越小,缩放比例[36000,250] + mapView.setViewpointScaleAsync(2800);//数字越大,放大比例越小,缩放比例[36000,250] ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 @@ -102,7 +104,7 @@ //设置地图显示在中心位置 Point point = new Point(Constant.DEFAULT_LNG, Constant.DEFAULT_LAT, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //网格和社区 (ID: 13) ServiceFeatureTable communityFeatureTable = new ServiceFeatureTable(Constant.BASE_MAP_SERVICE_URL + "/13"); @@ -135,6 +137,11 @@ mGraphicsOverlay = new GraphicsOverlay(); overlayGraphics = mGraphicsOverlay.getGraphics(); graphicsOverlays = mapView.getGraphicsOverlays(); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @SuppressLint("ClickableViewAccessibility") @@ -376,11 +383,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()), 1000); + loadingDialog.dismiss(); } } }); diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6a982c0..25931cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -131,7 +131,7 @@ overlayGraphics; private ListenableList graphicsOverlays; private GraphicsOverlay mGraphicsOverlay; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -91,7 +93,7 @@ caseType = getIntent().getStringExtra("type"); gson = new Gson(); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(1000);//数字越大,放大比例越小,缩放比例[36000,250] + mapView.setViewpointScaleAsync(2800);//数字越大,放大比例越小,缩放比例[36000,250] ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 @@ -102,7 +104,7 @@ //设置地图显示在中心位置 Point point = new Point(Constant.DEFAULT_LNG, Constant.DEFAULT_LAT, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //网格和社区 (ID: 13) ServiceFeatureTable communityFeatureTable = new ServiceFeatureTable(Constant.BASE_MAP_SERVICE_URL + "/13"); @@ -135,6 +137,11 @@ mGraphicsOverlay = new GraphicsOverlay(); overlayGraphics = mGraphicsOverlay.getGraphics(); graphicsOverlays = mapView.getGraphicsOverlays(); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @SuppressLint("ClickableViewAccessibility") @@ -376,11 +383,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()), 1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java index fca4476..f9cd111 100644 --- a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java +++ b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java @@ -26,6 +26,7 @@ import com.esri.arcgisruntime.symbology.PictureMarkerSymbol; import com.esri.arcgisruntime.util.ListenableList; import com.qmuiteam.qmui.widget.QMUITopBarLayout; +import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; import java.util.Arrays; @@ -41,6 +42,7 @@ MapView mapView; private double lng, lat; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -69,8 +71,6 @@ mapView.setAttributionTextVisible(false);//去掉左下角属性标识 ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); - arcGISMap.setMinScale(36000); - arcGISMap.setMaxScale(250); //创建底图、并设置底图图层 ArcGISTiledLayer baseLayer = new ArcGISTiledLayer(Constant.BASE_MAP_SERVICE_URL); Basemap basemap = new Basemap(baseLayer); @@ -88,6 +88,11 @@ arcGISMap.getOperationalLayers().addAll(Arrays.asList(communityLayer, pointLayer)); } mapView.setMap(arcGISMap); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @Override @@ -96,7 +101,7 @@ * [116.598359, 28.247870, 0.000000, NaN] SR: 4326 */ Point point = new Point(lng, lat, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //添加普通小圆点Marker // addSimpleMarker(point); @@ -135,12 +140,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: -// mapView.setViewpointCenterAsync(new Point(lng, lat)); + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()),1000); + loadingDialog.dismiss(); } } }); diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6a982c0..25931cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -131,7 +131,7 @@ overlayGraphics; private ListenableList graphicsOverlays; private GraphicsOverlay mGraphicsOverlay; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -91,7 +93,7 @@ caseType = getIntent().getStringExtra("type"); gson = new Gson(); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(1000);//数字越大,放大比例越小,缩放比例[36000,250] + mapView.setViewpointScaleAsync(2800);//数字越大,放大比例越小,缩放比例[36000,250] ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 @@ -102,7 +104,7 @@ //设置地图显示在中心位置 Point point = new Point(Constant.DEFAULT_LNG, Constant.DEFAULT_LAT, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //网格和社区 (ID: 13) ServiceFeatureTable communityFeatureTable = new ServiceFeatureTable(Constant.BASE_MAP_SERVICE_URL + "/13"); @@ -135,6 +137,11 @@ mGraphicsOverlay = new GraphicsOverlay(); overlayGraphics = mGraphicsOverlay.getGraphics(); graphicsOverlays = mapView.getGraphicsOverlays(); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @SuppressLint("ClickableViewAccessibility") @@ -376,11 +383,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()), 1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java index fca4476..f9cd111 100644 --- a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java +++ b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java @@ -26,6 +26,7 @@ import com.esri.arcgisruntime.symbology.PictureMarkerSymbol; import com.esri.arcgisruntime.util.ListenableList; import com.qmuiteam.qmui.widget.QMUITopBarLayout; +import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; import java.util.Arrays; @@ -41,6 +42,7 @@ MapView mapView; private double lng, lat; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -69,8 +71,6 @@ mapView.setAttributionTextVisible(false);//去掉左下角属性标识 ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); - arcGISMap.setMinScale(36000); - arcGISMap.setMaxScale(250); //创建底图、并设置底图图层 ArcGISTiledLayer baseLayer = new ArcGISTiledLayer(Constant.BASE_MAP_SERVICE_URL); Basemap basemap = new Basemap(baseLayer); @@ -88,6 +88,11 @@ arcGISMap.getOperationalLayers().addAll(Arrays.asList(communityLayer, pointLayer)); } mapView.setMap(arcGISMap); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @Override @@ -96,7 +101,7 @@ * [116.598359, 28.247870, 0.000000, NaN] SR: 4326 */ Point point = new Point(lng, lat, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //添加普通小圆点Marker // addSimpleMarker(point); @@ -135,12 +140,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: -// mapView.setViewpointCenterAsync(new Point(lng, lat)); + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()),1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java index 6bca509..4e7a008 100644 --- a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java @@ -89,6 +89,7 @@ progressDialog = new ProgressDialog(context); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setProgressDrawable(context.getResources().getDrawable(R.drawable.bg_progress)); + progressDialog.setCanceledOnTouchOutside(false); } @Override @@ -250,7 +251,7 @@ Uri data; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {//判断版本大于等于7.0 // 通过FileProvider创建一个content类型的Uri - data = FileProvider.getUriForFile(context, "com.casic.dcms.fileProvider", apk); + data = FileProvider.getUriForFile(context, "com.casic.dcms.install.fileProvider", apk); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);// 给目标应用一个临时授权 } else { data = Uri.fromFile(apk); diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6a982c0..25931cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -131,7 +131,7 @@ overlayGraphics; private ListenableList graphicsOverlays; private GraphicsOverlay mGraphicsOverlay; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -91,7 +93,7 @@ caseType = getIntent().getStringExtra("type"); gson = new Gson(); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(1000);//数字越大,放大比例越小,缩放比例[36000,250] + mapView.setViewpointScaleAsync(2800);//数字越大,放大比例越小,缩放比例[36000,250] ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 @@ -102,7 +104,7 @@ //设置地图显示在中心位置 Point point = new Point(Constant.DEFAULT_LNG, Constant.DEFAULT_LAT, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //网格和社区 (ID: 13) ServiceFeatureTable communityFeatureTable = new ServiceFeatureTable(Constant.BASE_MAP_SERVICE_URL + "/13"); @@ -135,6 +137,11 @@ mGraphicsOverlay = new GraphicsOverlay(); overlayGraphics = mGraphicsOverlay.getGraphics(); graphicsOverlays = mapView.getGraphicsOverlays(); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @SuppressLint("ClickableViewAccessibility") @@ -376,11 +383,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()), 1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java index fca4476..f9cd111 100644 --- a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java +++ b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java @@ -26,6 +26,7 @@ import com.esri.arcgisruntime.symbology.PictureMarkerSymbol; import com.esri.arcgisruntime.util.ListenableList; import com.qmuiteam.qmui.widget.QMUITopBarLayout; +import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; import java.util.Arrays; @@ -41,6 +42,7 @@ MapView mapView; private double lng, lat; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -69,8 +71,6 @@ mapView.setAttributionTextVisible(false);//去掉左下角属性标识 ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); - arcGISMap.setMinScale(36000); - arcGISMap.setMaxScale(250); //创建底图、并设置底图图层 ArcGISTiledLayer baseLayer = new ArcGISTiledLayer(Constant.BASE_MAP_SERVICE_URL); Basemap basemap = new Basemap(baseLayer); @@ -88,6 +88,11 @@ arcGISMap.getOperationalLayers().addAll(Arrays.asList(communityLayer, pointLayer)); } mapView.setMap(arcGISMap); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @Override @@ -96,7 +101,7 @@ * [116.598359, 28.247870, 0.000000, NaN] SR: 4326 */ Point point = new Point(lng, lat, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //添加普通小圆点Marker // addSimpleMarker(point); @@ -135,12 +140,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: -// mapView.setViewpointCenterAsync(new Point(lng, lat)); + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()),1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java index 6bca509..4e7a008 100644 --- a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java @@ -89,6 +89,7 @@ progressDialog = new ProgressDialog(context); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setProgressDrawable(context.getResources().getDrawable(R.drawable.bg_progress)); + progressDialog.setCanceledOnTouchOutside(false); } @Override @@ -250,7 +251,7 @@ Uri data; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {//判断版本大于等于7.0 // 通过FileProvider创建一个content类型的Uri - data = FileProvider.getUriForFile(context, "com.casic.dcms.fileProvider", apk); + data = FileProvider.getUriForFile(context, "com.casic.dcms.install.fileProvider", apk); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);// 给目标应用一个临时授权 } else { data = Uri.fromFile(apk); diff --git a/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java b/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java index 4fb14da..df6a3c9 100644 --- a/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java @@ -79,7 +79,7 @@ onlinePresenter.onReadyRetrofitRequest("", "", ""); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(32000); + mapView.setViewpointScaleAsync(64000); ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 diff --git a/app/build.gradle b/app/build.gradle index 9a6d2a1..045dd9e 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ applicationId "com.casic.dcms" minSdkVersion 21 targetSdkVersion 30 - versionCode 11 - versionName "v1.0.0.3" + versionCode 12 + versionName "v1.0.0.4" ndk { abiFilters "armeabi", "armeabi-v7a", "x86_64", "x86" } diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 6a982c0..25931cd 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -131,7 +131,7 @@ overlayGraphics; private ListenableList graphicsOverlays; private GraphicsOverlay mGraphicsOverlay; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -91,7 +93,7 @@ caseType = getIntent().getStringExtra("type"); gson = new Gson(); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(1000);//数字越大,放大比例越小,缩放比例[36000,250] + mapView.setViewpointScaleAsync(2800);//数字越大,放大比例越小,缩放比例[36000,250] ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 @@ -102,7 +104,7 @@ //设置地图显示在中心位置 Point point = new Point(Constant.DEFAULT_LNG, Constant.DEFAULT_LAT, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //网格和社区 (ID: 13) ServiceFeatureTable communityFeatureTable = new ServiceFeatureTable(Constant.BASE_MAP_SERVICE_URL + "/13"); @@ -135,6 +137,11 @@ mGraphicsOverlay = new GraphicsOverlay(); overlayGraphics = mGraphicsOverlay.getGraphics(); graphicsOverlays = mapView.getGraphicsOverlays(); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @SuppressLint("ClickableViewAccessibility") @@ -376,11 +383,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()), 1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java index fca4476..f9cd111 100644 --- a/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java +++ b/app/src/main/java/com/casic/dcms/ui/DisplayMapActivity.java @@ -26,6 +26,7 @@ import com.esri.arcgisruntime.symbology.PictureMarkerSymbol; import com.esri.arcgisruntime.util.ListenableList; import com.qmuiteam.qmui.widget.QMUITopBarLayout; +import com.qmuiteam.qmui.widget.dialog.QMUITipDialog; import java.util.Arrays; @@ -41,6 +42,7 @@ MapView mapView; private double lng, lat; + private QMUITipDialog loadingDialog; @Override public int initLayoutView() { @@ -69,8 +71,6 @@ mapView.setAttributionTextVisible(false);//去掉左下角属性标识 ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); - arcGISMap.setMinScale(36000); - arcGISMap.setMaxScale(250); //创建底图、并设置底图图层 ArcGISTiledLayer baseLayer = new ArcGISTiledLayer(Constant.BASE_MAP_SERVICE_URL); Basemap basemap = new Basemap(baseLayer); @@ -88,6 +88,11 @@ arcGISMap.getOperationalLayers().addAll(Arrays.asList(communityLayer, pointLayer)); } mapView.setMap(arcGISMap); + + loadingDialog = new QMUITipDialog.Builder(this) + .setIconType(QMUITipDialog.Builder.ICON_TYPE_LOADING) + .setTipWord("定位中,请稍后") + .create(); } @Override @@ -96,7 +101,7 @@ * [116.598359, 28.247870, 0.000000, NaN] SR: 4326 */ Point point = new Point(lng, lat, mapView.getSpatialReference()); - mapView.setViewpointCenterAsync(point, 1000);//标注到指定经纬度并放大地图显示 + mapView.setViewpointCenterAsync(point, 2800);//标注到指定经纬度并放大地图显示 //添加普通小圆点Marker // addSimpleMarker(point); @@ -135,12 +140,13 @@ mapView.setViewpointScaleAsync(mapView.getMapScale() * 2); break; case R.id.removeToLocalView: -// mapView.setViewpointCenterAsync(new Point(lng, lat)); + loadingDialog.show(); LocationHelper.obtainCurrentLocation(this, new ILocationListener() { @Override public void onLocationGet(Location location) { if (location != null) { - mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude())); + mapView.setViewpointCenterAsync(new Point(location.getLongitude(), location.getLatitude()),1000); + loadingDialog.dismiss(); } } }); diff --git a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java index 6bca509..4e7a008 100644 --- a/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java +++ b/app/src/main/java/com/casic/dcms/ui/fragment/MinePageFragment.java @@ -89,6 +89,7 @@ progressDialog = new ProgressDialog(context); progressDialog.setProgressStyle(ProgressDialog.STYLE_HORIZONTAL); progressDialog.setProgressDrawable(context.getResources().getDrawable(R.drawable.bg_progress)); + progressDialog.setCanceledOnTouchOutside(false); } @Override @@ -250,7 +251,7 @@ Uri data; if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) {//判断版本大于等于7.0 // 通过FileProvider创建一个content类型的Uri - data = FileProvider.getUriForFile(context, "com.casic.dcms.fileProvider", apk); + data = FileProvider.getUriForFile(context, "com.casic.dcms.install.fileProvider", apk); intent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);// 给目标应用一个临时授权 } else { data = Uri.fromFile(apk); diff --git a/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java b/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java index 4fb14da..df6a3c9 100644 --- a/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java +++ b/app/src/main/java/com/casic/dcms/ui/fragment/PersonOnMapFragment.java @@ -79,7 +79,7 @@ onlinePresenter.onReadyRetrofitRequest("", "", ""); mapView.setAttributionTextVisible(false);//去掉左下角属性标识 - mapView.setViewpointScaleAsync(32000); + mapView.setViewpointScaleAsync(64000); ArcGISMap arcGISMap = new ArcGISMap(BasemapStyle.ARCGIS_STREETS); //创建底图、并设置底图图层 diff --git a/app/src/main/res/xml/file_paths.xml b/app/src/main/res/xml/file_paths.xml index 023b133..86d8291 100644 --- a/app/src/main/res/xml/file_paths.xml +++ b/app/src/main/res/xml/file_paths.xml @@ -1,11 +1,11 @@ - - \ No newline at end of file