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

how to detect which polygon clicked? #19

Closed
d7coders opened this issue May 28, 2016 · 3 comments
Closed

how to detect which polygon clicked? #19

d7coders opened this issue May 28, 2016 · 3 comments

Comments

@d7coders
Copy link

@OverRide
public void onPolygonClick(Polygon polygon) {

}
@peacefulhuman
Copy link

I think you can do a HashMap or some other data structure and reference it by Polygon.getID() within the OnPolygonClickListener implementation. I did something similar with Polylines.

@andrewindayang
Copy link

When you draw your polygon, you can use Hash map to store the object with the polygon ID.

e.g : private Map<String, Object> markerMap;
markerMap.put(polygon.getId(), OBJECT);

to retrieve :
Object data = (Object) markerMap.get(polygon.getId()); --> you can get everything from the object.

@bellarm
Copy link
Contributor

bellarm commented Dec 19, 2017

Hi,
It looks like you have solved your problem. Have a look at the support page if you still have any questions.

@bellarm bellarm closed this as completed Dec 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants