You can use the current map to get the minimum zoomlevel at which the
given bounds (your polygon) will be completely visible. You can also
get the bounds of your current viewport and check whether the bounds
of the polygon collide (or are contained) within the bounds.

Check out:

map.getBoundsZoomLevel(bounds)
map.getBounds().contains(bounds)
map.getBounds().intersects(bounds)


On 3 feb, 07:52, Bill <[email protected]> wrote:
> Hi,
>
> I have a lot of polygons in a database (close to 5000), and I don't
> want to bog down the browser by trying to draw them if they won't be
> visible at the current zoom level.  I thought I might not even send
> the info back from the server, saving a bit of bandwidth.
>
> So I'm trying to use my SQL query to compare the current zoom level to
> a minimum zoom level for each polygon.
>
> My question: How do I calculate that minimum visible zoom level for my
> polygons?
>
> I have already stored max_lng, min_lng, max_lat, min_lat for each
> polygon, and I thought I might be able to use those values in this
> calculation.
>
> thanks,
>
> Bill Fisher
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to