Vra

I'm trying on this tutorial and now i need to get the coordinates of the points of the polygon that i draw here. Please someone explain how can i get the coordinates.

Was dit nuttig?

Oplossing

After the

drawingManager.setMap(map);

I added ​​

google.maps.event.addListener(drawingManager, 'polygoncomplete', function (polygon) {
    var coordinates = (polygon.getPath().getArray());
    // console.log(coordinates);
    window.alert("success"+coordinates);
});

Thanks david strachan.

Gelisensieer onder: CC-BY-SA met toeskrywing
Nie verbonde aan StackOverflow
scroll top