I'm searching for a way to draw a polyline via google maps v3. Once complete be able to edit the polyline and then continue drawing the same polyline.
I've read much about the DrawingManager (introduced in 3.7) and read much of the API of V3 found here:
https://developers.google.com/maps/documentation/javascript/overlays#drawing_tools
Which shows the example of this:
https://google-developers.appspot.com/maps/documentation/javascript/examples/drawing-tools
The developers.google example is great and allows the user to draw and complete the polyline by clicking on the last vertex. But once it's complete I cant seem to find out how to continue drawing on the same polyline. Is this possible?
I know that Google Maps API is up to version 10 (Frozen). I've even looked in their Release and Experimental versions but there's no talk of it there.
I would be open to any suggestions.
To edit a map, choose a map and click Open in My Maps. You'll be taken to My Maps, where you can edit your map.
Issue created with Google: http://code.google.com/p/gmaps-api-issues/issues/detail?id=5213 Hope it gets more "likes"
PolylineOptions in DrawingManagerOptions ignores the path atribute. So what you could do is to draw a new polyline between the end of the las polyline and the begining of the new polyline when it is drawn (on polylinecomplete event).
google.maps.event.addListener(drawingManager, 'polylinecomplete', function(event) {
if (event.type == google.maps.drawing.OverlayType.POLYLINE) {
//save last point
//draw a new polyline to join last final point and this first point if this isn't the first polyline
}
});
Hope it helps
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With