I have the bounding box of a map in leaflet with map.getBounds() which returns the NorthEast LatLng and SouthWest LatLng. How do I get the minimum and maximum of bothLat and Lng from this bounding box. I needed to use this information to fetch all coordinates in my db that falls within these ranges.

closed as off-topic by PolyGeo Aug 28 at 9:55

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "When seeking help to debug/write/improve code always provide the desired behavior, a specific problem/error and the shortest code (as formatted text, not pictures) needed to reproduce it in the question body. Providing a clear problem statement and a code attempt helps others to help you." – PolyGeo
If this question can be reworded to fit the rules in the help center, please edit the question.

  • map.getBounds() returns LatLngBounds object. See docs leafletjs.com/reference-1.5.0.html#latlngbounds how you can get rectangle bounds coordinates from it. – TomazicM Aug 28 at 9:47
  • Welcome to GIS SE! We're a little different from other sites. We're a Q&A site, not a discussion forum. For questions that involve code we ask that you show us where you are stuck with your own code by including a code snippet in your question. There is an edit button beneath your question which will enable you to do that and a {} button that enables you to format any highlighted code nicely. Please check out our short tour for more about how the site works. Thanks. – PolyGeo Aug 28 at 9:55

Browse other questions tagged or ask your own question.