V
V
v3shin2018-02-06 15:47:08
PHP
v3shin, 2018-02-06 15:47:08

How to display only visible markers on Google static map?

Hello. The task is this: there are 200+ markers in the database and you need to generate an image of a part of the map. Since describing all the markers is not enough length (Google has introduced a limit on the length of the image address), that is, the idea is to describe only those markers that should be visible on a static map. Zoom, center and size are known. Is there an option how to "dig" to the coordinates of the edges of the map in order to weed out unnecessary markers?
And is there a ready-made variant of clustering in php?
PS: The map is moved and zoomed by the user, and then, based on his actions, an image should be generated. Zoom and center are set by the user, size is wired in the script.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
F
freeExec, 2018-02-06
@v3shin

Google.map itself knows its bounds, you can ask it and send this data to the server. But you have a puncture in that the hardcoded size means that you will see much less in the picture than the user sees on the screen.

A
Artem, 2018-02-06
@proudmore

Does your map show the same area? Find out the edges of the area. Knowing them, you can determine whether a point belongs to this area or not.

S
skoval, 2018-02-07
@skoval

Find out the edges of the edges, and try to calculate, not calculated, and then you can find the coordinates of the point that was at the edge and the outer padding by the right pixel. It seems the best answer, do not listen to these woodpeckers, they do not rummage)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question