Handle when drawing of polygons is complete in google maps api v3

后端 未结 2 1105

It seems that drawing of polygons is asynchronous in google maps api v3. Try to click the \"Load\" button in this example:

http://jsfiddle.net/rmXXF/

the tex

相关标签:
2条回答
  • 2020-12-17 00:52

    By triggering a small recentering of the map after drawing all the polygons this is added to the same internal google maps event queue as can be seen in this example: http://jsfiddle.net/rmXXF/40/

    google.maps.event.addListener(map, 'idle', function() {
     document.getElementById('status').innerHTML = 'DONE';
    });
    

    and

    my_map.setCenter(new google.maps.LatLng(my_map.getCenter().lat(), my_map.getCenter().lng() + .000000001));
    
    0 讨论(0)
  • 2020-12-17 01:04

    You should use an overlay and listen to the drawing manager's 'rectanglecomplete' event. I can code up an example after lunch.

    David is right. I misread the documentation. Apologize. He should get the bounty.

    0 讨论(0)
提交回复
热议问题