There is a common code for unloading Placemark to the map (Appendix 1.). Further there is a stupid code of unloading from the base (Appendix 2.).

It is necessary to unload Placemark, with the help of ajax. For this, I need you to explain how to use the "Determination of coordinates" in the Yandex API.

Logically, I just need to be able to read the coordinates of the extreme points of the map display window and transfer them to the ajax script for further unloading.

Annex 1

Appendix 2

    1 answer 1

    You can create a card, subscribe to the event of changing the borders of the map. After changing the boundaries of the map request data. This code will, with each change, send requests to the server for new data:

    myMap.events.add('boundschange', function(e){ var bounds = e.get('newBounds'); // тут запросить данные от сервера и отобразить их }) 

    Then you request geolocation (there is an example of determining the user's location in the sandbox: https://tech.yandex.ru/maps/jsbox/2.1/geolocation ) and the map will request new data from the server when the map boundaries change.

    But the best option I see is the creation of a loading object manager and it will follow the map boundaries and make requests, you only need to process the data on the server and return the data correctly. You can read about it here: https://tech.yandex.ru/maps/doc/jsapi/2.1/dg/concepts/loading-object-manager/about-docpage/ We request geolocation as I indicated in the example above.

    • So I am downloading from the MySQL database and in fact I have no server implementation! And without it, LOM and ROM do not work! Well, or give advice on how to implement the server part, taking into account that I calculate the new coordinates when parsing the database? Well, or I don't catch up with something ... - Metius
    • Well then use the first option. Just in case, I throw another example of the server implementation of ROM if you go along the second path github.com/dimik/ymaps/tree/master/remote-object-manager-server - se0ga
    • Sorry for such a request stupid, but you can throw a more detailed example for the first case. With the work with MySQL. I just went through it and found nothing useful. PS Do not biy! - Metius
    • And what exactly does not work? If you need to realize everything, then it is already necessary not here, but on the freelance exchange. - se0ga
    • Well, like how to work with this event, with reference to MySQL. Here I have the js code and where and at what stage to use this event! That's what I'm talking about. Type trite how to import this event. - Metius