use of com.amap.api.maps.model.LatLngBounds in project Dxditor by kimi2009.
the class MapPageActivity method onResume.
/**
* 方法必须重写
*/
@Override
protected void onResume() {
super.onResume();
LatLng llC = new LatLng(35, 115);
LatLng llD = new LatLng(30, 120);
LatLngBounds bounds = new LatLngBounds.Builder().include(llC).include(llD).build();
aMap.moveCamera(CameraUpdateFactory.newLatLngBoundsRect(bounds, 10, 10, 10, 10));
mapView.onResume();
}
use of com.amap.api.maps.model.LatLngBounds in project LivingInCampus by DulCoder.
the class RouteOverlay method getLatLngBounds.
protected LatLngBounds getLatLngBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
b.include(new LatLng(startPoint.latitude, startPoint.longitude));
b.include(new LatLng(endPoint.latitude, endPoint.longitude));
return b.build();
}
use of com.amap.api.maps.model.LatLngBounds in project LivingInCampus by DulCoder.
the class RouteOverlay method zoomToSpan.
/**
* 移动镜头到当前的视角。
* @since V2.1.0
*/
public void zoomToSpan() {
if (startPoint != null) {
if (mAMap == null)
return;
try {
LatLngBounds bounds = getLatLngBounds();
mAMap.animateCamera(CameraUpdateFactory.newLatLngBounds(bounds, 50));
} catch (Throwable e) {
e.printStackTrace();
}
}
}
use of com.amap.api.maps.model.LatLngBounds in project LivingInCampus by DulCoder.
the class BusLineOverlay method zoomToSpan.
/**
* 移动镜头到当前的视角。
*
* @since V2.1.0
*/
public void zoomToSpan() {
if (mAMap == null)
return;
try {
List<LatLonPoint> coordin = mBusLineItem.getDirectionsCoordinates();
if (coordin != null && coordin.size() > 0) {
LatLngBounds bounds = getLatLngBounds(coordin);
mAMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 5));
}
} catch (Throwable e) {
e.printStackTrace();
}
}
use of com.amap.api.maps.model.LatLngBounds in project LivingInCampus by DulCoder.
the class DrivingRouteOverlay method getLatLngBounds.
@Override
protected LatLngBounds getLatLngBounds() {
LatLngBounds.Builder b = LatLngBounds.builder();
b.include(new LatLng(startPoint.latitude, startPoint.longitude));
b.include(new LatLng(endPoint.latitude, endPoint.longitude));
if (this.throughPointList != null && this.throughPointList.size() > 0) {
for (int i = 0; i < this.throughPointList.size(); i++) {
b.include(new LatLng(this.throughPointList.get(i).getLatitude(), this.throughPointList.get(i).getLongitude()));
}
}
return b.build();
}
Aggregations