PageSourceSearch

https://obitel-st-elisaveta.ru/media/front/js/map.js?1

js obitel-st-elisaveta.ru collected 2026-10-04 23:37:40 UTC 3,934 bytes, 130 lines download raw bytes

1Map = {
2    $map: null,
3    initProcess: false,
4    init: function () {
5        if (Map.initProcess) {
6            //   return false;
7        }
8        Map.initProcess = true;
9
10        ymaps.ready(init);
11
12        function init() {
13            var crds = [55.819531,37.467750],
14                zoom = 16,
15                height = 596;
16
17            if ($(window).width() <= 700){
18                crds = [55.819531,37.467750];
19            }
20
21            if ($(window).width() <= 380) {
22                height = 200;
23                zoom = 10;
24            } else if ($(window).width() <= 480) {
25                height = 280;
26                zoom = 11;
27            } else if ($(window).width() <= 540) {
28                height = 350;
29                zoom = 12;
30            } else if ($(window).width() <= 620) {
31                height = 400;
32                zoom = 13;
33            } else if ($(window).width() <= 700) {
34                height = 430;
35                zoom = 14;
36            } else if ($(window).width() <= 850) {
37                height = 490;
38            }
39
40            Map.$map.height(height);
41            $(' > ymaps', Map.$map).height(height);
42
43
44            if (!myMap) {
45                myMap = new ymaps.Map("mainMap", {
46                    center: crds,
47                    zoom: zoom
48                }, {
49                    minZoom: 6
50                });
51                myMap.behaviors.disable('scrollZoom');
52                myMap.controls.remove('searchControl');
53                myMap.controls.remove('ScaleLine');
54                myMap.controls.remove('mapTools');
55                myMap.controls.remove('trafficControl');
56                myMap.controls.remove('smallZoomControl');
57                myMap.controls.remove('typeSelector');
58                myMap.controls.remove('miniMap');
59                myMap.controls.remove('ZoomControl');
60            }
61            else {
62                myMap.setZoom(zoom);
63                myMap.setCenter(crds);
64            }
65            Map.renderMap();
66
67            var left = $(window).width() / 2 - 585;
68
69            if (left >= 0) {
70                $('#feedbackForm').css('left', left + 'px');
71                $('#showFeedback').css('left', left + 'px');
72            }else{
73                $('#feedbackForm').css('left', 0);
74                $('#showFeedback').css('left', 0);
75            }
76        }
77    },
78    renderMap: function () {
79        var myPlacemark,
80            html = $('#balloonBlock').html();
81
82        myMap.geoObjects.removeAll();
83
84        if ($(window).width() > 700) {
85            myPlacemark = new ymaps.Placemark([55.819531,37.467750], {
86                balloonContent: html
87            });
88
89            myMap.geoObjects.add(myPlacemark);
90            myPlacemark.balloon.open();
91        } else {
92            myPlacemark = new ymaps.Placemark([55.819531,37.467750]);
93            myMap.geoObjects.add(myPlacemark);
94        }
95        Map.initProcess = false;
96    },
97    show: function () {
98         // myMap && myMap.destroy();
99
100        if (Map.$map.length) {
101            if ($('#YMapLib').length) {
102                if (isYMaps()) {
103
104                    Map[Map.$map.data('func')]();
105                }
106                return false;
107            }
108
109            var fileref = document.createElement("script");
110            fileref.type = "text/javascript";
111            fileref.src = Map.$map.data('src');
112            fileref.id = 'YMapLib';
113            document.getElementById("mainMap").appendChild(fileref);
114            fileref.onload = function () {
115                if (isYMaps()) {
116                    Map[Map.$map.data('func')]();
117                }
118            };
119        }
120    }
121};
122
123function isYMaps() {
124    return typeof ymaps === "object";
125}
126
127$(window).load(function () {
128    Map.$map = $('#mainMap');
129    Map.show();
130});

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.