Skip to content

Commit

Permalink
Set polygon clickable option with style instead of forced true.
Browse files Browse the repository at this point in the history
(cherry picked from commit 253f099)
  • Loading branch information
Qwatcha authored and SeanG committed Apr 26, 2018
1 parent 0c7715f commit dd40a69
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
12 changes: 6 additions & 6 deletions library/src/com/google/maps/android/data/Renderer.java
Expand Up @@ -423,11 +423,11 @@ protected void storeData(HashMap<String, KmlStyle> styles,
*
* @param feature feature to add to the map
*/
public void addFeature(Feature feature) {
public void addFeature(Feature feature) {
Object mapObject = FEATURE_NOT_ON_MAP;
if (feature instanceof GeoJsonFeature) {
setFeatureDefaultStyles((GeoJsonFeature) feature);
}
if (feature instanceof GeoJsonFeature) {
setFeatureDefaultStyles((GeoJsonFeature) feature);
}
if (mLayerOnMap) {
if (mFeatures.containsKey(feature)) {
// Remove current map objects before adding new ones
Expand Down Expand Up @@ -637,7 +637,7 @@ private void setInlinePointStyle(MarkerOptions markerOptions, KmlStyle inlineSty
* @return Polyline object created from given LineString
*/
protected Polyline addLineStringToMap(PolylineOptions polylineOptions,
LineString lineString) {
LineString lineString) {
// Add coordinates
polylineOptions.addAll(lineString.getGeometryObject());
Polyline addedPolyline = mMap.addPolyline(polylineOptions);
Expand Down Expand Up @@ -680,7 +680,7 @@ protected Polygon addPolygonToMap(PolygonOptions polygonOptions, DataPolygon pol
polygonOptions.addHole(innerBoundary);
}
Polygon addedPolygon = mMap.addPolygon(polygonOptions);
addedPolygon.setClickable(true);
addedPolygon.setClickable(polygonOptions.isClickable());
return addedPolygon;
}

Expand Down
Expand Up @@ -166,6 +166,7 @@ public PolygonOptions toPolygonOptions() {
polygonOptions.strokeWidth(mPolygonOptions.getStrokeWidth());
polygonOptions.visible(mPolygonOptions.isVisible());
polygonOptions.zIndex(mPolygonOptions.getZIndex());
polygonOptions.clickable(mPolygonOptions.isClickable());
return polygonOptions;
}

Expand All @@ -182,4 +183,8 @@ public String toString() {
sb.append("\n}\n");
return sb.toString();
}

public void setClickable(boolean clickable) {
mPolygonOptions.clickable(clickable);
}
}

0 comments on commit dd40a69

Please sign in to comment.