Search in sources :

Example 1 with LatLngBounds

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();
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLng(com.amap.api.maps.model.LatLng)

Example 2 with LatLngBounds

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();
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLng(com.amap.api.maps.model.LatLng)

Example 3 with LatLngBounds

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();
        }
    }
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds)

Example 4 with LatLngBounds

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();
    }
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLonPoint(com.amap.api.services.core.LatLonPoint)

Example 5 with LatLngBounds

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();
}
Also used : LatLngBounds(com.amap.api.maps.model.LatLngBounds) LatLng(com.amap.api.maps.model.LatLng) LatLonPoint(com.amap.api.services.core.LatLonPoint)

Aggregations

LatLngBounds (com.amap.api.maps.model.LatLngBounds)5 LatLng (com.amap.api.maps.model.LatLng)3 LatLonPoint (com.amap.api.services.core.LatLonPoint)2