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

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

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

origin: airbnb/AirMapView

public Builder<T> addHole(@NonNull Iterable<LatLng> points) {
 this.polygonOptions.addHole(points);
 return this;
}
origin: googlemaps/android-maps-utils

/**
 * Adds a DataPolygon to the map as a Polygon
 *
 * @param polygonOptions
 * @param polygon      contains coordinates for the Polygon
 * @return Polygon object created from given DataPolygon
 */
protected Polygon addPolygonToMap(PolygonOptions polygonOptions, DataPolygon polygon) {
  // First array of coordinates are the outline
  polygonOptions.addAll(polygon.getOuterBoundaryCoordinates());
  // Following arrays are holes
  List<List<LatLng>> innerBoundaries = polygon.getInnerBoundaryCoordinates();
  for (List<LatLng> innerBoundary : innerBoundaries) {
    polygonOptions.addHole(innerBoundary);
  }
  Polygon addedPolygon = mMap.addPolygon(polygonOptions);
  addedPolygon.setClickable(polygonOptions.isClickable());
  return addedPolygon;
}
origin: googlemaps/android-samples

.addHole(createRectangle(new LatLng(-22, 128), 1, 1))
.addHole(createRectangle(new LatLng(-18, 133), 0.5, 1.5))
.fillColor(fillColorArgb)
.strokeColor(strokeColorArgb)
origin: mg6maciej/android-maps-extensions

public PolygonOptions addHole(Iterable<LatLng> points) {
  real.addHole(points);
  return this;
}
origin: wiglenet/wigle-wifi-wardriving

/**
 * Adds a GeoJsonPolygon to the map as a Polygon
 *
 * @param polygonStyle contains relevant styling properties for the Polygon
 * @param polygon      contains coordinates for the Polygon
 * @return Polygon object created from given GeoJsonPolygon
 */
private Polygon addPolygonToMap(GeoJsonPolygonStyle polygonStyle, GeoJsonPolygon polygon) {
  PolygonOptions polygonOptions = polygonStyle.toPolygonOptions();
  // First array of coordinates are the outline
  polygonOptions.addAll(polygon.getCoordinates().get(POLYGON_OUTER_COORDINATE_INDEX));
  // Following arrays are holes
  for (int i = POLYGON_INNER_COORDINATE_INDEX; i < polygon.getCoordinates().size();
      i++) {
    polygonOptions.addHole(polygon.getCoordinates().get(i));
  }
  Polygon addedPolygon = mMap.addPolygon(polygonOptions);
  addedPolygon.setClickable(true);
  return addedPolygon;
}
origin: wiglenet/wigle-wifi-wardriving

/**
 * Adds a KML Polygon to the map as a Polygon by combining the styling and coordinates
 *
 * @param polygon contains coordinates for the Polygon
 * @param style   contains relevant styling properties for the Polygon
 * @return Polygon object
 */
private Polygon addPolygonToMap(KmlPolygon polygon, KmlStyle style, KmlStyle inlineStyle) {
  PolygonOptions polygonOptions = style.getPolygonOptions();
  polygonOptions.addAll(polygon.getOuterBoundaryCoordinates());
  for (ArrayList<LatLng> innerBoundary : polygon.getInnerBoundaryCoordinates()) {
    polygonOptions.addHole(innerBoundary);
  }
  if (inlineStyle != null) {
    setInlinePolygonStyle(polygonOptions, inlineStyle);
  } else if (style.isPolyRandomColorMode()) {
    polygonOptions.fillColor(KmlStyle.computeRandomColor(polygonOptions.getFillColor()));
  }
  return mMap.addPolygon(polygonOptions);
}
com.google.android.gms.maps.modelPolygonOptionsaddHole

Popular methods of PolygonOptions

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (ScheduledExecutorService)
  • findViewById (Activity)
  • putExtra (Intent)
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • TreeSet (java.util)
    TreeSet is an implementation of SortedSet. All optional operations (adding and removing) are support
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • Top plugins for WebStorm
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