Algorithm to determine which points should be visible on a map based on zoom

Posted by lgratian on Stack Overflow See other posts from Stack Overflow or by lgratian
Published on 2010-03-26T13:11:01Z Indexed on 2010/03/26 13:13 UTC
Read the original article Hit count: 355

Filed under:
|
|
|

Hi! I'm making a Google Maps-like application for a course at my Uni (not something complex, it should load the map of a city for example, not the whole world). The map can have many layers, including markers (restaurants, hospitals, etc.) The problem is that when you have many points and you zoom out the map it doesn't look right. At this zoom level only some points need to be visible (and at the maximum map size, all points). The question is: how can you determine which points should be visible for a specified zoom level?

Because I have implemented a PR Quadtree to speed up rendering I thought that I could define some "high-priority" markers (that are always visible, defined in the map editor) and put them in a queue. At each step a marker is removed from the queue and all it's neighbors that are at least D units away (D depends on the zoom levels) are chosen and inserted in the queue, and so on. Is there any better way than the algorithm I thought of?

Thanks in advance!

© Stack Overflow or respective owner

Related posts about gis

Related posts about maps