Tabnine Logo
PolygonOptions.getStrokeWidth
Code IndexAdd Tabnine to your IDE (free)

How to use
getStrokeWidth
method
in
com.google.android.gms.maps.model.PolygonOptions

Best Java code snippets using com.google.android.gms.maps.model.PolygonOptions.getStrokeWidth (Showing top 14 results out of 315)

origin: googlemaps/android-maps-utils

/**
 * Gets the stroke width of the GeoJsonPolygon in screen pixels
 *
 * @return stroke width of the GeoJsonPolygon
 */
public float getStrokeWidth() {
  return mPolygonOptions.getStrokeWidth();
}
origin: airbnb/AirMapView

@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);
 }
}
origin: googlemaps/android-maps-utils

/**
 *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;
}
origin: googlemaps/android-maps-utils

public void testStrokeWidth() throws Exception {
  polygonStyle.setStrokeWidth(20.0f);
  assertEquals(20.0f, polygonStyle.getStrokeWidth());
  assertEquals(20.0f, polygonStyle.toPolygonOptions().getStrokeWidth());
}
origin: googlemaps/android-maps-utils

/**
 * 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;
}
origin: googlemaps/android-maps-utils

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);
}
origin: googlemaps/android-maps-utils

/**
 * 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()));
  }
}
origin: googlemaps/android-maps-utils

  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());
  }
}
origin: wiglenet/wigle-wifi-wardriving

/**
 * Gets the stroke width of the GeoJsonPolygon in screen pixels
 *
 * @return stroke width of the GeoJsonPolygon
 */
public float getStrokeWidth() {
  return mPolygonOptions.getStrokeWidth();
}
origin: mg6maciej/android-maps-extensions

public float getStrokeWidth() {
  return real.getStrokeWidth();
}
origin: wiglenet/wigle-wifi-wardriving

/**
 *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;
}
origin: wiglenet/wigle-wifi-wardriving

/**
 * 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;
}
origin: wiglenet/wigle-wifi-wardriving

/**
 * 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()));
  }
}
origin: car2go/AnyMaps

output.getStrokeWidth(),
com.google.android.gms.maps.modelPolygonOptionsgetStrokeWidth

Popular methods of PolygonOptions

  • fillColor
  • strokeColor
  • <init>
  • strokeWidth
  • addAll
  • add
  • getFillColor
  • getStrokeColor
  • addHole
  • zIndex
  • geodesic
  • getZIndex
  • geodesic,
  • getZIndex,
  • isGeodesic,
  • isVisible,
  • visible,
  • clickable,
  • getPoints,
  • isClickable,
  • strokePattern

Popular in Java

  • Reading from database using SQL prepared statement
  • findViewById (Activity)
  • getExternalFilesDir (Context)
  • getSystemService (Context)
  • Color (java.awt)
    The Color class is used to encapsulate colors in the default sRGB color space or colors in arbitrary
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Date (java.sql)
    A class which can consume and produce dates in SQL Date format. Dates are represented in SQL as yyyy
  • ReentrantLock (java.util.concurrent.locks)
    A reentrant mutual exclusion Lock with the same basic behavior and semantics as the implicit monitor
  • Manifest (java.util.jar)
    The Manifest class is used to obtain attribute information for a JarFile and its entries.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now