PageSourceSearch

https://www.zabedu.ru/map/map.js?v5

js zabedu.ru collected 2026-10-02 07:42:30 UTC 4,970 bytes, 130 lines download raw bytes

1ymaps.ready(init);
2
3objects = [];
4
5function init() {
6    // Создание карты.
7    // https://tech.yandex.ru/maps/doc/jsapi/2.1/dg/concepts/map-docpage/
8    var myMap = new ymaps.Map("map", {
9        // Координаты центра карты.
10        // Порядок по умолчнию: «широта, долгота».
11        center: [52.0317, 113.501],
12        // Уровень масштабирования. Допустимые значения:
13        // от 0 (весь мир) до 19.
14        zoom: 5,
15        // Элементы управления
16        // https://tech.yandex.ru/maps/doc/jsapi/2.1/dg/concepts/controls/standard-docpage/
17        controls: [
18
19            'zoomControl', // Ползунок масштаба
20            'rulerControl', // Линейка
21            'routeButtonControl', // Панель маршрутизации
22            'trafficControl', // Пробки
23            'typeSelector', // Переключатель слоев карты
24            //'fullscreenControl', // Полноэкранный режим
25
26            // Поисковая строка
27            new ymaps.control.SearchControl({
28                options: {
29                    // вид - поисковая строка
30                    size: 'large',
31                    // Включим возможность искать не только топонимы, но и организации.
32                    provider: 'yandex#search'
33                }
34            })
35
36        ]
37    });
38
39
40    var fullscreenControl = new ymaps.control.FullscreenControl();
41    myMap.controls.add(fullscreenControl);
42    fullscreenControl.enterFullscreen();
43
44    for (let key in _coords) {
45        let bP = _coords[key];
46        let polygon = new ymaps.Polygon(bP, {hintContent: ""}, {
47            fillColor: "#ff0000",
48            interactivityModel: "default#transparent",
49            strokeWidth: 2,
50            strokeColor: "#ff0000",
51            strokeOpacity: 1,
52            opacity: 0.3
53        });
54        myMap.geoObjects.add(polygon)
55    }
56
57    for (let _key in _districts) {
58        let _d = _districts[_key];
59        let _c = _d.coordinates;
60        for (let _k in _c) {
61            let bP = _c[_k];
62            let polygon = new ymaps.Polygon(bP, {
63                hintContent: "<b>" + _d.name + "</b>",
64                custom: 1,
65                url: _d.url
66            }, {
67                fillColor: "#ff0000",
68                interactivityModel: "default#transparent",
69                strokeWidth: 1,
70                strokeColor: "#ffff00",
71                strokeOpacity: 1,
72                opacity: 0.3
73            });
74            polygon.events.add(["mouseenter", "mouseleave"], function (g) {
75                if (g.get("target").properties.get("custom") !== "undefined") {
76                    if (g.get("target").properties.get("custom") === 1) {
77                        g.get("target").options.set("opacity", g.get("type") === "mouseenter" ? 0.7 : 0.3);
78                        g.get("target").options.set("fillColor", g.get("type") === "mouseenter" ? "#ffff00" : "#ff0000")
79                    }
80                }
81            });
82            myMap.geoObjects.add(polygon)
83        }
84    }
85
86
87    $.getJSON('objects.php', function(data) {
88        objects1.forEach(function (item, i, arr) {
89            myPlacemark = new ymaps.Placemark([item.coord[0], item.coord[1]], {
90                // Хинт показывается при наведении мышкой на иконку метки.
91                hintContent: item.name,
92                // Балун откроется при клике по метке.
93                balloonContent: item.name
94            }, {
95                iconColor: item.color,
96            });
97
98            item.placemark = myPlacemark;
99
100        });
101
102        data.forEach(function (item, i, arr) {
103            myPlacemark = new ymaps.Placemark([item.latitude, item.longitude], {
104                // Хинт показывается при наведении мышкой на иконку метки.
105                hintContent: item.name,
106                // Балун откроется при клике по метке.
107                balloonContent: item.name
108            }, {
109                iconColor: item.color,
110            });
111
112            item.placemark = myPlacemark;
113
114            objects1.push(item);
115
116        });
117    });
118
119    $('.ffff').click(function (event) {
120        objects1.forEach(function (item, i, arr) {
121            if (item.type == $(event.target).attr('ftype')) {
122                if ($(event.target).prop("checked")) {
123                    myMap.geoObjects.add(item.placemark);
124                } else {
125                    myMap.geoObjects.remove(item.placemark);
126                }
127            }
128        });
129    });
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.