Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(document).ready(function() {
- if($('#map-contact').length > 0) {
- ymaps.ready(function(){
- map = new ymaps.Map("map-contact", {
- center: [55.757248755096576,37.5840621667767],
- controls: [],
- zoom: 17
- });
- map.behaviors.disable('scrollZoom');
- map.behaviors.disable('drag');
- window.addEventListener('resize', function() {
- if(window.innerWidth > 576 &&window.innerWidth <= 768) {
- map.setCenter([55.75654694845152,37.588514633741426])
- } else if(window.innerWidth > 450 &&window.innerWidth <= 576) {
- map.setCenter([55.756280742613356,37.58837515887264])
- } else if(window.innerWidth > 375 &&window.innerWidth <= 450) {
- map.setCenter([55.75611738812743,37.58837515887264])
- } else if(window.innerWidth > 300 &&window.innerWidth <= 375) {
- map.setCenter([55.75589958107738,37.58854682024961])
- }
- })
- // Создаём макет иконки.
- MyIconLayout = ymaps.templateLayoutFactory.createClass([
- '<svg width="200" height="200" style="position: absolute; top: -23px; left: -23px;">',
- '<use href="#sym01"/>',
- '</svg>',
- ].join('')),
- myPlacemark = new ymaps.Placemark([55.759243,37.588440], {}, {
- iconLayout: MyIconLayout
- });
- map.geoObjects
- .add(myPlacemark);
- });
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement