Answer the question
In order to leave comments, you need to log in
How to display labels from the database on YandexMap under PhoneGap?
DD, there is such a problem...
You need to display tags on the map... they are stored in a database on the server....
Yandex allows you to display tags in Javascript
ymaps.ready(function () {
var myMap = new ymaps.Map('map', {
center: [position.coords.latitude, position.coords.longitude ],
zoom: 15,
controls: ['zoomControl']
}),
myPlacemark = new ymaps.Placemark(myMap.getCenter(), {
hintContent: 'Собственный значок метки'
}, {
iconLayout: 'default#image',
iconImageHref: 'http://vk.mirada.kz/ava/1a.png',
iconImageSize: [45, 57]
});
myMap.geoObjects.add(myPlacemark)
/////вот ниже метка//////
.add(new ymaps.Placemark([52.281754, 76.981974], {
balloonContent: 'цвет <strong>воды пляжа бонди</strong>'
}, {
iconLayout: 'default#image',
iconImageHref: '2.png',
iconImageSize: [45, 57]
}));
});
.add(new ymaps.Placemark([52.275171, 76.962104], {
balloonContent: 'цвет <strong>воды пляжа бонди</strong>'
}, {
iconLayout: 'default#image',
iconImageHref: '3.png',
iconImageSize: [45, 57]
}))
Answer the question
In order to leave comments, you need to log in
There are three options:
1. just add your php script to:
myMap.geoObjects.add(myPlacemark);
and connect this case with a script
2. Throw out the scripts from the php output and leave json, load with ajax and perform the addition based on ajax data
3. Include the script directly in the file, which draws the map itself
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question