/** * Creates a new PolygonStyle object */ public GeoJsonPolygonStyle() { mPolygonOptions = new PolygonOptions(); }
/** * Creates a new Style object */ public Style() { mMarkerOptions = new MarkerOptions(); mPolylineOptions = new PolylineOptions(); mPolygonOptions = new PolygonOptions(); }
/** *Creates a new PolygonOption from given properties of an existing PolygonOption * @param originalPolygonOption An existing PolygonOption instance * @param isFill Whether the fill for a polygon is set * @param isOutline Whether the outline for a polygon is set * @return A new PolygonOption */ private static PolygonOptions createPolygonOptions (PolygonOptions originalPolygonOption, boolean isFill, boolean isOutline) { PolygonOptions polygonOptions = new PolygonOptions(); if (isFill) { polygonOptions.fillColor(originalPolygonOption.getFillColor()); } if (isOutline) { polygonOptions.strokeColor(originalPolygonOption.getStrokeColor()); polygonOptions.strokeWidth(originalPolygonOption.getStrokeWidth()); } return polygonOptions; }
/** * Gets a new PolygonOptions object containing styles for the GeoJsonPolygon * * @return new PolygonOptions object */ public PolygonOptions toPolygonOptions() { PolygonOptions polygonOptions = new PolygonOptions(); polygonOptions.fillColor(mPolygonOptions.getFillColor()); polygonOptions.geodesic(mPolygonOptions.isGeodesic()); polygonOptions.strokeColor(mPolygonOptions.getStrokeColor()); polygonOptions.strokeWidth(mPolygonOptions.getStrokeWidth()); polygonOptions.visible(mPolygonOptions.isVisible()); polygonOptions.zIndex(mPolygonOptions.getZIndex()); polygonOptions.clickable(mPolygonOptions.isClickable()); return polygonOptions; }
triangle.add(new LatLng(28.06025,-82.41030)); // Should match first point mMap.addPolygon(new PolygonOptions() .addAll(triangle) .fillColor(Color.BLUE - ALPHA_ADJUSTMENT) mMap.addPolygon(new PolygonOptions() .addAll(simplifiedTriangle) .fillColor(Color.YELLOW - ALPHA_ADJUSTMENT) mMap.addPolygon(new PolygonOptions() .addAll(oval) .fillColor(Color.BLUE - ALPHA_ADJUSTMENT) mMap.addPolygon(new PolygonOptions() .addAll(simplifiedOval) .fillColor(Color.YELLOW - ALPHA_ADJUSTMENT)
new PolygonOptions().add(new LatLng(40.748429, -73.984573), new LatLng(40.753393, -73.996311), new LatLng(40.758393, -73.992705),
mMutablePolygon = map.addPolygon(new PolygonOptions() .addAll(createRectangle(CENTER, 5, 5)) .addHole(createRectangle(new LatLng(-22, 128), 1, 1))
/** * Creates a new PolygonStyle object */ public GeoJsonPolygonStyle() { mPolygonOptions = new PolygonOptions(); }
/** * Add a Polyline and a Polygon to the map. * The Polyline connects Melbourne, Adelaide and Perth. The Polygon is located in the Northern * Territory (Australia). */ private void addPolyObjects() { mMap.addPolyline((new PolylineOptions()) .add(MELBOURNE, ADELAIDE, PERTH) .color(Color.GREEN) .width(5f)); mMap.addPolygon(new PolygonOptions() .add(POLYGON) .fillColor(Color.CYAN) .strokeColor(Color.BLUE) .strokeWidth(5)); }
mDarwinPolygon = mMap.addPolygon(new PolygonOptions() .add( new LatLng(DARWIN.latitude + 3, DARWIN.longitude - 3),
/** * Creates a new Style object */ /* package */ KmlStyle() { mStyleId = null; mMarkerOptions = new MarkerOptions(); mPolylineOptions = new PolylineOptions(); mPolygonOptions = new PolygonOptions(); mBalloonOptions = new HashMap<String, String>(); mStylesSet = new HashSet<String>(); mScale = INITIAL_SCALE; mMarkerColor = 0; mIconRandomColorMode = false; mLineRandomColorMode = false; mPolyRandomColorMode = false; }
area = SphericalUtil.computeArea(trace); areaOverlay = mMap.addPolygon( new PolygonOptions().addAll(trace).strokeWidth(0).fillColor(COLOR_POINT)); } else { area = 0;
/** *Creates a new PolygonOption from given properties of an existing PolygonOption * @param originalPolygonOption An existing PolygonOption instance * @param isFill Whether the fill for a polygon is set * @param isOutline Whether the outline for a polygon is set * @return A new PolygonOption */ private static PolygonOptions createPolygonOptions (PolygonOptions originalPolygonOption, boolean isFill, boolean isOutline) { PolygonOptions polygonOptions = new PolygonOptions(); if (isFill) { polygonOptions.fillColor(originalPolygonOption.getFillColor()); } if (isOutline) { polygonOptions.strokeColor(originalPolygonOption.getStrokeColor()); polygonOptions.strokeWidth(originalPolygonOption.getStrokeWidth()); } return polygonOptions; }
@Override public com.google.android.gms.maps.model.PolygonOptions map(PolygonOptions input) { List<LatLng> points = AnyMapAdapter.adaptList(com.car2go.maps.model.LatLng.class, input.getPoints()); return new com.google.android.gms.maps.model.PolygonOptions() .fillColor(input.getFillColor()) .strokeColor(input.getStrokeColor()) .strokeWidth(input.getStrokeWidth()) .addAll(points); }
private void drawPolygon(List<LatLng> latLngList) { if (polygon != null) { polygon.remove(); } PolygonOptions polygonOptions = new PolygonOptions(); polygonOptions.fillColor(drawingOption.getFillColor()); polygonOptions.strokeColor(drawingOption.getStrokeColor()); polygonOptions.strokeWidth(drawingOption.getStrokeWidth()); polygonOptions.addAll(latLngList); polygon = mMap.addPolygon(polygonOptions); }
protected void testePolygon(GoogleMap map) { PolygonOptions p = new PolygonOptions(); p.add(new LatLng(-23.564391, -46.651717)); p.add(new LatLng(-23.565391, -46.652717)); p.add(new LatLng(-23.564282, -46.654337)); p.add(new LatLng(-23.563114, -46.653283)); // p.add(new LatLng(-23.564391, -46.651717)); p.strokeColor(Color.GREEN); p.fillColor(Color.RED); Polygon polygon = map.addPolygon(p); polygon.setFillColor(Color.YELLOW); }
/** * Gets a new PolygonOptions object containing styles for the GeoJsonPolygon * * @return new PolygonOptions object */ public PolygonOptions toPolygonOptions() { PolygonOptions polygonOptions = new PolygonOptions(); polygonOptions.fillColor(mPolygonOptions.getFillColor()); polygonOptions.geodesic(mPolygonOptions.isGeodesic()); polygonOptions.strokeColor(mPolygonOptions.getStrokeColor()); polygonOptions.strokeWidth(mPolygonOptions.getStrokeWidth()); polygonOptions.visible(mPolygonOptions.isVisible()); polygonOptions.zIndex(mPolygonOptions.getZIndex()); return polygonOptions; }
count++; googleMap.addPolygon( new PolygonOptions() .fillColor(polygon.getFillColor()) .strokeColor(polygon.getUiOptions().getColor())