Created
March 31, 2014 13:51
-
-
Save Shapit0/9892695 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var coord = $("#objmap").html(); | |
var coords = jQuery.parseJSON(coord); | |
ymaps.ready(init); | |
var myMap; | |
function init(){ | |
myMap = new ymaps.Map ("map", { | |
center: [59.931554, 30.316818], | |
zoom: 10 | |
}); | |
myCollection = new ymaps.GeoObjectCollection({}, { | |
preset: 'twirl#redIcon', //все метки красные | |
draggable: true // и их можно перемещать | |
}); | |
// или myCollection = new ymaps.GeoObjectArray(...); | |
for (var i = 0; i < coords.length; i++) { | |
myCollection.add(new ymaps.Placemark(coords[i])); | |
} | |
myMap.geoObjects.add(myCollection); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment