area estimation in viewpoint of map using leaflet
问题 I have a map with several areas denoted by a polygon. I want to enable some options and display some markers when the polygon is right in the middle of map and the right zoom level. How can I detect this. I can get the map bounds but have no idea how to use it to check if the polygon is in the map. Thanks for the help! 回答1: First, you'll need to get the bounds of your polygon. Use the getBounds function described here to get the bounds of your polygon. // This will return an L.LatLngBounds