How to get Bounding Box coordinates for my google map window

后端 未结 1 1345
感动是毒
感动是毒 2021-01-01 23:12

I am working on a project that includes google maps api v3 and PostGres.

What I want to do is to pass the bounding box coordinates(bottom left and top right) of my m

相关标签:
1条回答
  • 2021-01-01 23:45

    The question is using the Google Maps API v2, use the Google Maps API v3 equivalent google.maps.Map.getBounds().

    The bounds will not be available until the bounds_changed event has fired, so wrap it in a listener for bounds_changed

    google.maps.event.addListener(map, "bounds_changed", function() {
       // send the new bounds back to your server
       alert("map bounds{"+map.getBounds());
    });
    
    0 讨论(0)
提交回复
热议问题