Answer the question
In order to leave comments, you need to log in
How to insert an image into the balloon?
Good day! Can you tell me how to insert an image into the balloon?
Here is the js code:
ymaps.ready(init);
function init () {
var myMap = new ymaps.Map('map', {
center: [59.850097, 30.271213],
zoom: 12
}, {
searchControlProvider: 'yandex#search'
}),
objectManager = new ymaps.ObjectManager({
clusterize: true,
gridSize: 32
});
objectManager.objects.options.set({
iconLayout: 'default#image',
iconImageHref: './img/playground.png'
});
objectManager.clusters.options.set('preset', 'islands#greenClusterIcons');
myMap.geoObjects.add(objectManager);
$.ajax({
url: "./json/data.json"
}).done(function(data) {
objectManager.add(data);
});
}
{
"type": "FeatureCollection",
"features": [
{"type": "Feature", "id": 0, "geometry": {"type": "Point", "coordinates": [59.850692, 30.257390]}, "properties": {"balloonContent": "Содержимое балуна", "clusterCaption": "Еще одна метка", "hintContent": "Текст подсказки"}}
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question