Created
August 28, 2017 11:47
-
-
Save webchi/473a937e607eb718450e96bec1424b9a to your computer and use it in GitHub Desktop.
Yandex MAP object from json
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
ymaps.ready() | |
.done(function (ym) { | |
myMap = new ymaps.Map("map", { | |
center: [59.704197, 30.023431], | |
zoom: 13 | |
}); | |
jQuery.getJSON('home/cameras.json', function (json) { | |
var geoObjects = ym.geoQuery(json) | |
.addToMap(myMap); | |
//.applyBoundsToMap(myMap, { | |
// checkZoomRange: true | |
//}); | |
}); | |
var myBalloonLayout = ymaps.templateLayoutFactory.createClass( | |
'<iframe width="320" height="240" src=$[properties.link] frameborder="0" allowfullscreen></iframe>' | |
); | |
ymaps.layout.storage.add('cam#layout', myBalloonLayout); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment