private LatLngBounds getLatLngBounds(List<LatLonPoint> coordin) { LatLngBounds.Builder b = LatLngBounds.builder(); for (int i = 0; i < coordin.size(); i++) { b.include(new LatLng(coordin.get(i).getLatitude(), coordin.get(i) .getLongitude())); } return b.build(); }
private LatLngBounds getBounds(List<LatLng> pointlist) { LatLngBounds.Builder b = LatLngBounds.builder(); if (pointlist == null) { return b.build(); } for (int i = 0; i < pointlist.size(); i++) { b.include(pointlist.get(i)); } return b.build(); } }
private LatLngBounds getLatLngBounds() { LatLngBounds.Builder b = LatLngBounds.builder(); for (int i = 0; i < mPois.size(); i++) { b.include(new LatLng(mPois.get(i).getLatLonPoint().getLatitude(), mPois.get(i).getLatLonPoint().getLongitude())); } return b.build(); }
private void drawPolygon(GeoFence fence) { final List<List<DPoint>> pointList = fence.getPointList(); if (null == pointList || pointList.isEmpty()) { return; } for (List<DPoint> subList : pointList) { List<LatLng> lst = new ArrayList<LatLng>(); PolygonOptions polygonOption = new PolygonOptions(); for (DPoint point : subList) { lst.add(new LatLng(point.getLatitude(), point.getLongitude())); boundsBuilder.include( new LatLng(point.getLatitude(), point.getLongitude())); } polygonOption.addAll(lst); polygonOption.strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH); mAMap.addPolygon(polygonOption); } }
private void drawPolygon(GeoFence fence) { final List<List<DPoint>> pointList = fence.getPointList(); if (null == pointList || pointList.isEmpty()) { return; } for (List<DPoint> subList : pointList) { List<LatLng> lst = new ArrayList<LatLng>(); PolygonOptions polygonOption = new PolygonOptions(); for (DPoint point : subList) { lst.add(new LatLng(point.getLatitude(), point.getLongitude())); boundsBuilder.include( new LatLng(point.getLatitude(), point.getLongitude())); } polygonOption.addAll(lst); polygonOption.strokeColor(Const.STROKE_COLOR).strokeWidth(Const.STROKE_WIDTH) .fillColor(Const.FILL_COLOR); mAMap.addPolygon(polygonOption); } }
@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(); }
@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(); }
public void setProperCamera(List<LatLng> lists) { Builder builder = LatLngBounds.builder(); if (lists == null || lists.size() == 0) { return; } for (LatLng latlng : lists) { builder.include(latlng); } try { LatLngBounds bounds = builder.build(); mAMap.moveCamera(CameraUpdateFactory.newLatLngBounds(bounds, 20)); } catch (IllegalStateException e) { e.printStackTrace(); } }
@Override public void onAnotherClick(Marker marker, List<ClusterItem> clusterItems) { Toast.makeText(MainActivity.this,">>>>>>>点击了商家聚合点",Toast.LENGTH_SHORT).show(); if(aMap.getCameraPosition().zoom<=18){ LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (ClusterItem clusterItem : clusterItems) { builder.include(clusterItem.getPosition()); } LatLngBounds latLngBounds = builder.build(); aMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds,10 )); } } });
@Override public void onClick(Marker marker, List<ClusterItem> clusterItems) { Toast.makeText(MainActivity.this,">>>>>>>点击了用户聚合点",Toast.LENGTH_SHORT).show(); if(aMap.getCameraPosition().zoom<=18){ LatLngBounds.Builder builder = new LatLngBounds.Builder(); for (ClusterItem clusterItem : clusterItems) { builder.include(clusterItem.getPosition()); } LatLngBounds latLngBounds = builder.build(); aMap.animateCamera(CameraUpdateFactory.newLatLngBounds(latLngBounds,10 )); } } });
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }
private LatLngBounds getLatLngBounds() { LatLngBounds.Builder b = LatLngBounds.builder(); for (int i = 0; i < mPois.size(); i++) { b.include(new LatLng(mPois.get(i).getLatLonPoint().getLatitude(), mPois.get(i).getLatLonPoint().getLongitude())); } return b.build(); }
private void drawCircle(GeoFence fence) { LatLng center = new LatLng(fence.getCenter().getLatitude(), fence.getCenter().getLongitude()); // 绘制一个圆形 mAMap.addCircle(new CircleOptions().center(center) .radius(fence.getRadius()).strokeColor(Const.STROKE_COLOR) .fillColor(Const.FILL_COLOR).strokeWidth(Const.STROKE_WIDTH)); boundsBuilder.include(center); }