This commit is contained in:
Emanuel Mutschlechner
2018-08-30 13:58:13 +02:00
parent 5247eb66bc
commit 206beb1655
24 changed files with 506 additions and 14353 deletions

38
resources/js/services/yandex.js vendored Normal file
View File

@@ -0,0 +1,38 @@
import {isDefined, logError} from '../utils/helper';
export default {
NAME: 'yandex',
createMap(element, mapData) {
if (!isDefined(window.ymaps)) {
logError('ymaps is undefined');
return;
}
const {lat, lng, zoom} = mapData;
const map = new window.ymaps.Map(element, {
center: [lat, lng],
zoom,
});
// window.google.maps.event.addListenerOnce(map, 'idle', () => {
// fadeElementIn(element);
// });
return map;
},
createMarker(map, markerData) {
const {title, lat, lng, url} = markerData;
const marker = new window.ymaps.Placemark([lat, lng], {
hintContent: title,
});
// if (url) {
// marker.addListener('click', () => {
// openUrl(url);
// });
// }
map.geoObjects.add(marker);
},
};