D
D
Dmitry2017-02-03 12:01:18
PHP
Dmitry, 2017-02-03 12:01:18

How to make a filter by objects on the Yandex map (via the Yandex API)?

Understanding the Yandex Maps API. There is a php site. There is a database of objects (let's say real estate). There is a form through which the user adds an object to the database (MySQL). Those. he enters a geographic name and the object is added to the database.
And there is a map search. Those. a map is displayed on which all objects from the database are displayed. A good example of how it should be displayed like this: www.raiffeisen.ru/offices
First question:
How to initially display objects on the map - with this, let's say, figured it out. But here's how to update the map when changing the filter parameters (for a refactorer, for example, "display ATMs", "display branches", etc. - it's not entirely clear. After all, filters are not part of the map API. I assume that this is implemented in this way: when changing the filter parameters, the block with the map is updated via ajax (a request is made from the database, objects with the specified parameters are retrieved) and the map is displayed again. Am I right?
And the second question:
Avito has the following functionality: search on the map - objects are displayed on the map, and below the map these objects are displayed in the form of a list. At what exactly those objects that are displayed on the map are displayed, i.e. fit on the map screen. If you change the scale of the map, for example, zoom in, i.e. the number of objects will decrease and accordingly it will decrease in the list under the map. How to do this, I did not even get close. How to extract data on the number of objects displayed on the screen from the map, and even do it on the zoom event?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2017-02-03
@freeExec

You filter the answer from your database by the border of the visible part of the map and the selected type of object, still elementary. You also request this data using the search button and when moving the map, changing the scale, and at least after the user's request :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question