@Override public void updatePolygonsPaths(List<List<LatLong>> paths) { for (Polygon poly : polygonsPaths) { poly.remove(); } for (List<LatLong> contour : paths) { PolygonOptions pathOptions = new PolygonOptions(); pathOptions.stroke(new Stroke(POLYGONS_PATH_DEFAULT_WIDTH,POLYGONS_PATH_DEFAULT_COLOR)); final List<LatLng> pathPoints = new ArrayList<LatLng>(contour.size()); for (LatLong coord : contour) { pathPoints.add(DroneHelper.CoordToBaiduLatLang(coord)); } pathOptions.points(pathPoints); polygonsPaths.add((Polygon)getBaiduMap().addOverlay(pathOptions)); } }
public void createOrUpdateFenceShow(int geoFenceRadius, LatLng latLng) { CircleOptions fenceCircleOverlayTemp = new CircleOptions();//实例化地理围栏圆形覆盖物 fenceCircleOverlayTemp.fillColor(0x16ff00bb); //园内填充颜色 fenceCircleOverlayTemp.center(latLng); //圆的原点坐标 fenceCircleOverlayTemp.stroke(new Stroke(5, Color.rgb(0xff, 0x00, 0x7b)));//圆的边框 fenceCircleOverlayTemp.radius(geoFenceRadius); //圆的半径 fenceCircleOverlay = fenceCircleOverlayTemp; refreshMapUI(); }
@Override public void addCameraFootprint(FootPrint footprintToBeDraw) { PolygonOptions pathOptions = new PolygonOptions(); pathOptions.stroke(new Stroke(FOOTPRINT_DEFAULT_WIDTH,FOOTPRINT_DEFAULT_COLOR)); pathOptions.fillColor(FOOTPRINT_FILL_COLOR); final List<LatLng> pathPoints = new ArrayList<LatLng>(); for (LatLong vertex : footprintToBeDraw.getVertexInGlobalFrame()) { pathPoints.add(DroneHelper.CoordToBaiduLatLang(vertex)); } pathOptions.points(pathPoints); getBaiduMap().addOverlay(pathOptions); }