Interactive Polygons
I'm submitting a ... (check one with "x") [x] question [ ] any problem or bug report [ ] feature request
If you choose 'problem or bug report', please select OS: (check one with "x") [ ] Android [ ] iOS
I know that your plugin doesn't have this feature now but is it possible to have a feature where polygons are draggable and/or resizable? I know that the Google javascript API allows dragging polygons but it appears that mobile SDKs don't allow it. Do you know?
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/class/Polyline/getPoints/README.md
https://github.com/mapsplugin/cordova-plugin-googlemaps-doc/blob/master/v2.0.0/class/Polygon/getPoints/README.md
That is great! That's a feature I need!
Is there also a way to press the polygon and drag it to a new location?
Is there also a way to press the polygon and drag it to a new location?
There is no feature something like that.
But you can catch the POLYGON_CLICK event with latlng, then insert it to the baseArrayClass instance.
The idea is something like this.
map.addPolygon({
....,
clickable: true // <-- default: false
}, function(polygon) {
var points = polygon.getPoints();
points.on('added', function(latLng) {
map.addMarker({
position: latLng
}, function(marker) {
...
});
});
polygon.addEventListener(plugin.google.maps.event.POLYGON_CLICK, function(latLng) {
points.push(latLng);
})
});
I know you want to implement the editable property. I consider it, but I don't have enough time to implement it.
So if you implement it instead of me, and send it as a pull request, I will welcome to pay some amount for you (because you save my time a lot).
Ok I will implement that if I have the time to do it. Thanks for the quick response.
Good. I close this thread at once, but you can reply or refer from a PR anytime.