/** * Gets the stroke width of the GeoJsonPolygon in screen pixels * * @return stroke width of the GeoJsonPolygon */ public float getStrokeWidth() { return mPolygonOptions.getStrokeWidth(); }
@Override public <T> void addPolygon(AirMapPolygon<T> polygon) { try { JSONArray array = new JSONArray(); for (LatLng point : polygon.getPolygonOptions().getPoints()) { JSONObject json = new JSONObject(); json.put("lat", point.latitude); json.put("lng", point.longitude); array.put(json); } webView.loadUrl(String.format(Locale.US, "javascript:addPolygon(" + array.toString() + ", %1$d, %2$d, %3$d, %4$d);", polygon.getId(), (int) polygon.getPolygonOptions().getStrokeWidth(), polygon.getPolygonOptions().getStrokeColor(), polygon.getPolygonOptions().getFillColor())); } catch (JSONException e) { Log.e(TAG, "error constructing polyline JSON", e); } }
/** *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; }
public void testStrokeWidth() throws Exception { polygonStyle.setStrokeWidth(20.0f); assertEquals(20.0f, polygonStyle.getStrokeWidth()); assertEquals(20.0f, polygonStyle.toPolygonOptions().getStrokeWidth()); }
/** * 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; }
public void testWidth() throws Exception { KmlStyle kmlStyle = new KmlStyle(); assertNotNull(kmlStyle); assertNotNull(kmlStyle.getPolygonOptions()); assertNotNull(kmlStyle.getPolylineOptions()); assertEquals(kmlStyle.getPolylineOptions().getWidth(), 10.0f); assertEquals(kmlStyle.getPolygonOptions().getStrokeWidth(), 10.0f); kmlStyle.setWidth(11.0f); assertEquals(kmlStyle.getPolylineOptions().getWidth(), 11.0f); assertEquals(kmlStyle.getPolygonOptions().getStrokeWidth(), 11.0f); }
/** * Sets the inline polygon style by copying over the styles that have been set * * @param polygonOptions polygon options object to add inline styles to * @param inlineStyle inline styles to apply */ private void setInlinePolygonStyle(PolygonOptions polygonOptions, KmlStyle inlineStyle) { PolygonOptions inlinePolygonOptions = inlineStyle.getPolygonOptions(); if (inlineStyle.hasFill() && inlineStyle.isStyleSet("fillColor")) { polygonOptions.fillColor(inlinePolygonOptions.getFillColor()); } if (inlineStyle.hasOutline()) { if (inlineStyle.isStyleSet("outlineColor")) { polygonOptions.strokeColor(inlinePolygonOptions.getStrokeColor()); } if (inlineStyle.isStyleSet("width")) { polygonOptions.strokeWidth(inlinePolygonOptions.getStrokeWidth()); } } if (inlineStyle.isPolyRandomColorMode()) { polygonOptions.fillColor(KmlStyle.computeRandomColor(inlinePolygonOptions.getFillColor())); } }
public void testDefaultGetPolygonOptions() throws Exception { assertEquals(Color.TRANSPARENT, polygonStyle.toPolygonOptions().getFillColor()); assertFalse(polygonStyle.toPolygonOptions().isGeodesic()); assertEquals(Color.BLACK, polygonStyle.toPolygonOptions().getStrokeColor()); assertEquals(10.0f, polygonStyle.toPolygonOptions().getStrokeWidth()); assertTrue(polygonStyle.isVisible()); assertEquals(0.0f, polygonStyle.toPolygonOptions().getZIndex()); } }
/** * Gets the stroke width of the GeoJsonPolygon in screen pixels * * @return stroke width of the GeoJsonPolygon */ public float getStrokeWidth() { return mPolygonOptions.getStrokeWidth(); }
public float getStrokeWidth() { return real.getStrokeWidth(); }
/** *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()); return polygonOptions; }
/** * Sets the inline polygon style by copying over the styles that have been set * * @param polygonOptions polygon options object to add inline styles to * @param inlineStyle inline styles to apply */ private void setInlinePolygonStyle(PolygonOptions polygonOptions, KmlStyle inlineStyle) { PolygonOptions inlinePolygonOptions = inlineStyle.getPolygonOptions(); if (inlineStyle.hasFill() && inlineStyle.isStyleSet("fillColor")) { polygonOptions.fillColor(inlinePolygonOptions.getFillColor()); } if (inlineStyle.hasOutline()) { if (inlineStyle.isStyleSet("outlineColor")) { polygonOptions.strokeColor(inlinePolygonOptions.getStrokeColor()); } if (inlineStyle.isStyleSet("width")) { polygonOptions.strokeWidth(inlinePolygonOptions.getStrokeWidth()); } } if (inlineStyle.isPolyRandomColorMode()) { polygonOptions.fillColor(KmlStyle.computeRandomColor(inlinePolygonOptions.getFillColor())); } }
output.getStrokeWidth(),