A
A
agreIT2020-02-11 17:00:39
JavaScript
agreIT, 2020-02-11 17:00:39

How to apply iconLayout labels with Ajax on Yandex map?

There is a style created via templateLayoutFactory
How to apply it to labels?

style
MyIconLayout = ymaps.templateLayoutFactory.createClass('{{ properties.count }}');

Ajax data
{
    "type": "FeatureCollection",
    "features": [
        {"type": "Feature", "id": 0, "geometry": {"type": "Point", "coordinates": [55.831903, 37.411961]}, "options": {"iconLayout":"MyIconLayout"}, "properties": {"balloonContent": "Содержимое балуна", "clusterCaption": "Еще одна метка", "hintContent": "Текст подсказки"}},
        {"type": "Feature", "id": 1, "geometry": {"type": "Point", "coordinates": [55.763338, 37.565466]}, "options": {"iconLayout":"MyIconLayout"}, "properties": {"balloonContent": "Содержимое балуна", "clusterCaption": "Еще одна метка", "hintContent": "Текст подсказки"}},
        {"type": "Feature", "id": 2, "geometry": {"type": "Point", "coordinates": [55.863338, 37.565466]}, "options": {"iconLayout":"MyIconLayout"}, "properties": {"balloonContent": "Содержимое балуна", "clusterCaption": "Еще одна метка", "hintContent": "Текст подсказки", "color": "red"}}
    ]
}

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