Меню
ymaps.ready(function () { var map; ymaps.geolocation.get().then(function (res) { var mapContainer = $('#map'), bounds = res.geoObjects.get(0).properties.get('boundedBy'), mapState = ymaps.util.bounds.getCenterAndZoom( bounds, [mapContainer.width(), mapContainer.height()] ); createMap(mapState); }, function (e) { createMap({ center: [55.751574, 37.573856], zoom: 2 }); }); function createMap (state) { map = new ymaps.Map('map', state); } });
DEV