Adding many tokens kills my google maps - how to do it?

I'm stuck here again. I have a database with more than 120,000 coordinates that I need to display on Google maps integrated into my application. The fact is that I found that the hard way simply iterates over all the coordinates and creates a separate marker for each and adds it using the addOverlay function, killing the browser. So there definitely should be a wrong way to do this - I read a little about clustering or grouping the zoom level - I understand that it makes no sense to render all markers, especially if most of them will not be visible in the non-displayed parts of the map, except that I don't know how to make this work.

How to fix it here. Please guys, I need help here :(

+3
source share
8 answers

There is a good comparison of different methods here http://www.svennerberg.com/2009/01/handling-large-amounts-of-markers-in-google-maps/

However, given your bullet volume, you definitely want to use a technique that only displays bullets that should be visible in the current view (assuming the number is modest - unless the link uses methods to create reasonable things)

+8
source

120 000 , , - . . , .

: SO , PHP. API , , , . , , . , 3000 - , 120 000. !

+3

Google, , , Telco.

, , ( , ), , . , , .

, . (400). 20x20 , 400 .

, , , , .

, 400 . , , , - .

, .

, , , , Google Maps, , . , Google, , .

+2

. . ( ), Google.

+1

There is a fairly simple solution. Use an HTML5 canvas, although it sounds weird, its the fastest way to load up to 10,000 markers, as well as shortcuts that the browser will certainly not be able to handle if it's a regular marker. Not ordinary markers, but light markers.

0
source

Source: https://habr.com/ru/post/1708060/


All Articles