修改单个定位点地图缩放比例
This commit is contained in:
@@ -348,8 +348,13 @@ class EmergencyFragment :
|
|||||||
mAMap?.addMarker(markerOption)
|
mAMap?.addMarker(markerOption)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (markerList.size == 1) {
|
||||||
|
MapUtils.setMapZoonloAndZoom(mAMap, LatLng(markerList.get(0).latitude, markerList.get(0).longitude),11)
|
||||||
|
} else {
|
||||||
MapUtils.setMapZoonlo(mAMap, 200, ArrayList(newlist))
|
MapUtils.setMapZoonlo(mAMap, 200, ArrayList(newlist))
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,8 +36,12 @@ public class MapUtils {
|
|||||||
public static void setMapZoonlo(AMap map, int padding, LatLngBounds.Builder builder){
|
public static void setMapZoonlo(AMap map, int padding, LatLngBounds.Builder builder){
|
||||||
LatLngBounds bounds = builder.build();
|
LatLngBounds bounds = builder.build();
|
||||||
map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding));
|
map.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, padding));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void setMapZoonloAndZoom(AMap map, LatLng latLng, int zoom){
|
||||||
|
map.animateCamera(CameraUpdateFactory.newLatLngZoom(latLng,zoom));
|
||||||
|
}
|
||||||
|
|
||||||
public static void setMapZoonlo(AMap map, int padding, ArrayList<LocationResourceBean> list){
|
public static void setMapZoonlo(AMap map, int padding, ArrayList<LocationResourceBean> list){
|
||||||
LatLngBounds.Builder builder = LatLngBounds.builder();
|
LatLngBounds.Builder builder = LatLngBounds.builder();
|
||||||
if (list==null||list.size()==0) {
|
if (list==null||list.size()==0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user