-
Notifications
You must be signed in to change notification settings - Fork 918
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
Add in ability to click on polygons, circles and ground overlays #124
Conversation
You can now catch polygon click events in PhoneGap, iOS supports all types such as polygon, polyline, circle, etc whereas Android is only polygons at this point.
Merged into the issue123 branch by hand, then I will test. |
@lookaflyingdonkey Thank you for sending the pull request. Unfortunately, there is a bug. const POINTS = [
new plugin.google.maps.LatLng(38.548852, 139.784086),
new plugin.google.maps.LatLng(32.548852, 139.784086),
new plugin.google.maps.LatLng(18.332898, -157.921418),
new plugin.google.maps.LatLng(24.332898, -157.921418),
];
map.moveCamera({
'target': POINTS
});
map.addPolygon({
'points': POINTS,
'strokeColor' : '#AA00FF',
'strokeWidth': 5,
}, function(polygon) {
polygon.on(plugin.google.maps.event.OVERLAY_CLICK, function() {
polygon.setFillColor("blue");
alert("clicked");
});
}); |
I'm trying to fix this using map.getProjection() now. |
I finally managed to implement the OVERLAY_CLICK event for Polyline, Polygon, Circle, and GroundOverlay both Android and iOS. |
Looks good! Thanks for tidying up a bit, should be a great addition! |
For lover who want to test this feature before releasing v1.1.4, you can check out ffb64d3. $> git clone https://github.com/wf9a5m75/phonegap-googlemaps-plugin.git
$> git checkout ffb64d3
$> cd (your project dir)
$> cordova plugin add (path to the phonegap-googlemaps-plugin dir) --variable API_KEY_FOR_ANDROID= --variable API_KEY_FOR_IOS= |
For me this PR is not working on iOS. See this issue: |
See #123 for original discussion.
I have now added in the ability for android to click on circles and ground overlays.
Cheers,
Dean