/** * Sets the width of the LineString in screen pixels * * @param width width value of the LineString */ public void setLineStringWidth(float width) { mPolylineOptions.width(width); }
/** * Creates a new PolylineOption from given properties of an existing PolylineOption * @param originalPolylineOption An existing PolylineOption instance * @return A new PolylineOption */ private static PolylineOptions createPolylineOptions (PolylineOptions originalPolylineOption) { PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.color(originalPolylineOption.getColor()); polylineOptions.width(originalPolylineOption.getWidth()); return polylineOptions; }
/** * Add this polyline to the given {@link GoogleMap} instance * * @param googleMap the {@link GoogleMap} instance to which the polyline will be added */ public void addToGoogleMap(GoogleMap googleMap) { // add the polyline and keep a reference so it can be removed googlePolyline = googleMap.addPolyline(new PolylineOptions() .addAll(points) .width(strokeWidth) .color(strokeColor)); }
/** * Sets the inline linestring style by copying over the styles that have been set * * @param polylineOptions polygon options object to add inline styles to * @param inlineStyle inline styles to apply */ private void setInlineLineStringStyle(PolylineOptions polylineOptions, KmlStyle inlineStyle) { PolylineOptions inlinePolylineOptions = inlineStyle.getPolylineOptions(); if (inlineStyle.isStyleSet("outlineColor")) { polylineOptions.color(inlinePolylineOptions.getColor()); } if (inlineStyle.isStyleSet("width")) { polylineOptions.width(inlinePolylineOptions.getWidth()); } if (inlineStyle.isLineRandomColorMode()) { polylineOptions.color(KmlStyle.computeRandomColor(inlinePolylineOptions.getColor())); } }
/** * Gets a new PolylineOptions object containing styles for the GeoJsonLineString * * @return new PolylineOptions object */ public PolylineOptions toPolylineOptions() { PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.color(mPolylineOptions.getColor()); polylineOptions.clickable(mPolylineOptions.isClickable()); polylineOptions.geodesic(mPolylineOptions.isGeodesic()); polylineOptions.visible(mPolylineOptions.isVisible()); polylineOptions.width(mPolylineOptions.getWidth()); polylineOptions.zIndex(mPolylineOptions.getZIndex()); polylineOptions.pattern(getPattern()); return polylineOptions; }
new LatLng(40.748963847316034, -73.96807193756104)) .width(5).color(Color.RED);
@Override public void onCameraMoveStarted(int reason) { if (!isCanceled) { mMap.clear(); } String reasonText = "UNKNOWN_REASON"; currPolylineOptions = new PolylineOptions().width(5); switch (reason) { case OnCameraMoveStartedListener.REASON_GESTURE: currPolylineOptions.color(Color.BLUE); reasonText = "GESTURE"; break; case OnCameraMoveStartedListener.REASON_API_ANIMATION: currPolylineOptions.color(Color.RED); reasonText = "API_ANIMATION"; break; case OnCameraMoveStartedListener.REASON_DEVELOPER_ANIMATION: currPolylineOptions.color(Color.GREEN); reasonText = "DEVELOPER_ANIMATION"; break; } Log.i(TAG, "onCameraMoveStarted(" + reasonText + ")"); addCameraTargetToPath(); }
public PolylineOptions width(float width) { real.width(width); return this; }
public CurveOptions width(float width) { real.width(width); return this; }
/** * 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)); }
.add(PERTH, BRISBANE) .color(Color.rgb(103, 24, 173)) .width(30) .clickable(true)); mPolyline.setTag(new CustomTag("Perth to Brisbane polyline"));
/** * Sets the width of the GeoJsonLineString in screen pixels * * @param width width value of the GeoJsonLineString */ public void setWidth(float width) { mPolylineOptions.width(width); styleChanged(); }
/** * Sets the line width for a Polyline and a Polygon * * @param width Line width for a Polyline and a Polygon */ /* package */ void setWidth(Float width) { mPolylineOptions.width(width); mPolygonOptions.strokeWidth(width); mStylesSet.add("width"); }
public void addPolyline(final ArrayList<LatLng> polylines) { this.polylines = polylines; PolylineOptions options = new PolylineOptions(); for (int i = 1; i < polylines.size(); i++) { options.add(polylines.get(i - 1), polylines.get(i)).width(10).color(Color.RED).geodesic(true); } currentPolyline = googleMap.addPolyline(options); }
/** * Creates a new PolylineOption from given properties of an existing PolylineOption * @param originalPolylineOption An existing PolylineOption instance * @return A new PolylineOption */ private static PolylineOptions createPolylineOptions (PolylineOptions originalPolylineOption) { PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.color(originalPolylineOption.getColor()); polylineOptions.width(originalPolylineOption.getWidth()); return polylineOptions; }
@Override public com.google.android.gms.maps.model.PolylineOptions map(PolylineOptions input) { List<LatLng> points = AnyMapAdapter.adaptList(com.car2go.maps.model.LatLng.class, input.getPoints()); return new com.google.android.gms.maps.model.PolylineOptions() .color(input.getColor()) .width(input.getWidth()) .addAll(points); }
private void drawPolyline(List<LatLng> latLngList) { if (polyline != null) { polyline.remove(); } PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.color(drawingOption.getStrokeColor()); polylineOptions.width(drawingOption.getStrokeWidth()); polylineOptions.addAll(latLngList); polyline = mMap.addPolyline(polylineOptions); }
/** * Gets a new PolylineOptions object containing styles for the GeoJsonLineString * * @return new PolylineOptions object */ public PolylineOptions toPolylineOptions() { PolylineOptions polylineOptions = new PolylineOptions(); polylineOptions.color(mPolylineOptions.getColor()); polylineOptions.clickable(mPolylineOptions.isClickable()); polylineOptions.geodesic(mPolylineOptions.isGeodesic()); polylineOptions.visible(mPolylineOptions.isVisible()); polylineOptions.width(mPolylineOptions.getWidth()); polylineOptions.zIndex(mPolylineOptions.getZIndex()); return polylineOptions; }