Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set polygon clickable option with style instead of forced true. #454

Merged
merged 1 commit into from May 1, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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);
}
}