Skip to content

Instantly share code, notes, and snippets.

@webchi
Created August 28, 2017 11:47
Show Gist options
  • Save webchi/473a937e607eb718450e96bec1424b9a to your computer and use it in GitHub Desktop.
Save webchi/473a937e607eb718450e96bec1424b9a to your computer and use it in GitHub Desktop.
Yandex MAP object from json
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