Created
December 4, 2018 12:19
-
-
Save anoriar/45857e01d36e5bc5b481eb8aaa6c52ec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function createMap(){ | |
myMap = new ymaps.Map($map[0], { | |
center: [start.lat, start.lan], | |
zoom: 15, | |
autoFitToViewport:'always', | |
controls: [] | |
},{ | |
//чтобы убрать кнопку открыть в яндекс картах | |
suppressMapOpenBlock: true | |
}); | |
//кнопка на яндекс карте | |
firstButton = new ymaps.control.Button("Кнопка"); | |
firstButton.events.add( | |
'press', | |
function () { | |
//онли маркеры | |
// window.open("https://yandex.ru/maps/?from=api-maps&l=map&ll=37.463730%2C55.774537&origin=jsapi_2_1_71&pt=37.523653%2C55.777084~37.464925%2C55.809372~37.464464%2C55.809454~37.532337%2C55.789865~37.47677%2C55.728129~37.533275%2C55.800968~37.380866%2C55.766747~37.538039%2C55.748969~37.538586%2C55.748879~37.539347%2C55.74906&z=9"); | |
//поиск по яндекс картам + маркеры | |
window.open("https://maps.yandex.ru/?l=map&text=Московский ювелирный завод, Московская область&ll=37.463730%2C55.774537&origin=jsapi_2_1_71&pt=37.523653%2C55.777084~37.464925%2C55.809372~37.464464%2C55.809454~37.532337%2C55.789865~37.47677%2C55.728129~37.533275%2C55.800968~37.380866%2C55.766747~37.538039%2C55.748969~37.538586%2C55.748879~37.539347%2C55.74906&z=9"); | |
} | |
); | |
myMap.controls.add(firstButton, {float: 'left'}); | |
//myMap.behaviors.disable(['scrollZoom']); | |
myMap.controls.add(new ymaps.control.ZoomControl()); | |
setMarkers(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment