且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

服务器端Google标记集群 - Python / Django

更新时间:2023-11-27 22:13:10

我在这里写了一篇关于我使用Python和Django的方法的博文:



http://www.quanative.com/2010/01/01/server-side-marker-clustering-for-google-maps-with-python/


After experimenting with client side approach to clustering large numbers of Google markers I decided that it won't be possible for my project (social network with 28,000+ users).

Are there any examples of clustering the coordinates on the server side - preferably in Python/Django?

The way I would like this to work is to gradually index the markers based on their proximity (radius) and zoom level.

In another words when a new user registers he/she is automatically assigned to a certain 'group' of markers that are close to each other thus increasing the 'group's' counter. What's being send to the server is just a small number of 'groups'. Only when the zoom level/scale of map is 1:1 - actual users are shown on the map.

That way the client side will have to deal only with 10-50 markers per request/zoom level.

I wrote a blog post about my approach using Python and Django here:

http://www.quanative.com/2010/01/01/server-side-marker-clustering-for-google-maps-with-python/