O
O
OptimusPrime56452022-02-27 13:06:02
PHP
OptimusPrime5645, 2022-02-27 13:06:02

How to get a list of ids that are included in the cluster when clicking on it yandex.maps?

Hello. There is a yandex maps api
map, labels are displayed on the map, I output them as json

like this:

{"type":"Feature","id":"15","id_d":"29","geometry":{"type":"Point","coordinates":["56.333355","43.954962"]},"properties":{"hintContent":"168 \u20bd"}}


there are also clusters in which several labels are stored,

if there is only one label, then I just get id_d (the value that I need) through the click event, and not the label id (example below), and pass it when clicking via ajax to the php handler, the same thing I need to do if there are several labels in one building and there is a cluster. When clicking on it, I should get several values.

objectManager.objects.events.add('click', function (e) {
        var objectId=e.get('objectId'),
                object = objectManager.objects.getById(objectId),
                id_d = object.id_d;


The question is this: if you move the map away, then clusters with a sum of marks will appear, when you click on them, the map will increase to the building (maximum scale), then you need to click on it again to see what's there.
So here's how I can get all the id_ds that are in this cluster when I click on this cluster and pass it to ajax.

Now I just have some kind of window that appears in which I can show the html block, but I need to simply pass the id of the tags that are inside these tags and pass it to ajax when clicking

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question