public void setOverlayVisibleBounds(VisibleBoundsVO data) { if (mOverlays != null && mOverlays.size() > 0) { LatLngBounds.Builder builder = LatLngBounds.builder(); for (int i = 0; i < mOverlays.size(); i++) { LatLng item = mOverlays.get(i); builder.include(item); } aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), data.getPadding())); } }
public void setMarkerVisibleBounds(VisibleBoundsVO data) { List<Marker> list = aMap.getMapScreenMarkers(); if (list != null && list.size() > 0) { LatLngBounds.Builder builder = LatLngBounds.builder(); for (int i = 0; i < list.size(); i++) { LatLng item = list.get(i).getPosition(); builder.include(item); } aMap.moveCamera(CameraUpdateFactory.newLatLngBounds(builder.build(), data.getPadding())); } }
private 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(); }
protected LatLngBounds getLatLngBounds() { Builder builder = LatLngBounds.builder(); builder.include(new LatLng(this.startPoint.latitude, this.startPoint.longitude)); builder.include(new LatLng(this.endPoint.latitude, this.endPoint.longitude)); if (this.b != null && this.b.size() > 0) { for (int i = 0; i < this.b.size(); i++) { builder.include( new LatLng( ((LatLonPoint) this.b.get(i)).getLatitude(), ((LatLonPoint) this.b.get(i)).getLongitude())); } } return builder.build(); }