PageSourceSearch

https://syemslona.ru/media/js/map.js

js syemslona.ru collected 2026-10-07 03:38:16 UTC 3,447 bytes, 107 lines download raw bytes

1$(document).ready(function()
2{
3    ymaps.ready(init);
4    var myMap;
5
6    function init()
7    {
8    	ymaps.geocode(name_city, { results: 1 }).then(function (res) 
9		{
10	        // Выбираем первый результат геокодирования.
11	        var firstGeoObject = res.geoObjects.get(0);
12	        
13	        var coords = firstGeoObject.geometry.getCoordinates();
14	        
15	        myMap = new ymaps.Map("map", {center: coords, zoom: 4, controls: ['zoomControl']});
16
17	        var clusterIcons = [{ href: rootPath + "media/images/placemarker.png", size: [40, 55], offset: [-20, -50] }];
18	      	        
19	        var MyIconContentLayout = ymaps.templateLayoutFactory.createClass('<p style="color: #000; font-weight: bold; margin-top: 20px; text-align: center;">{{properties.geoObjects.length}}</p>');
20	       
21	        var geoObjects = [];
22
23 	        var clusterer = new ymaps.Clusterer({
24 	    	   clusterIcons: clusterIcons,
25               clusterNumbers: [1],
26               minClusterSize: 1, 
27               maxZoom: 6,
28               clusterIconContentLayout: MyIconContentLayout,
29               gridSize: 256,
30               hasBalloon: false
31             });
32
33			restaurants_list.forEach(function (restaurant, i, restaurants_list) {
34				var coordinates_restaurant = restaurant[1].split(",");
35
36				geoObjects[i] = new ymaps.Placemark(coordinates_restaurant,
37					{
38						balloonContent: "<div class=\"name-canteen-baloon\">" + restaurant[0] + "</div>" +
39							"<div class =\"phone-canteen-baloon\">" + restaurant[2] + "</div>" +
40							"<div class =\"schedule-canteen-baloon\">" + restaurant[3] + "</div>" +
41							"<div class =\"info-canteen-baloon\">" + restaurant[4] + "</div>"
42					},
43					{
44						iconLayout: "default#image",
45						iconImageHref: rootPath + "media/images/placemarker.png",
46						iconImageSize: [40, 55],
47						iconImageOffset: [-20, -50],
48						balloonMaxWidth: 182
49					});
50
51				geoObjects[i].events.add("click", function () {
52					myMap.setZoom(16);
53					myMap.setCenter(coordinates_restaurant);
54				});
55
56			});
57
58			clusterer.add(geoObjects);
59			myMap.geoObjects.add(clusterer);
60
61			myMap.controls.remove("searchControl");
62			myMap.controls.remove("trafficControl");
63			myMap.controls.remove("typeSelector");
64
65			if ( location.pathname.includes('about-work') || location.pathname.includes('vacancy') ) {
66				myMap.setCenter([56.03,92.90]);
67				myMap.setZoom(11);
68			} else if (typeof (carteens) != undefined && carteens)
69				myMap.setZoom(11);
70			else {
71				myMap.setBounds(clusterer.getBounds());
72				myMap.setZoom(6);
73			}
74		});
75    }
76
77    
78    $("#cities-map-list li").click(function()
79	{
80    	var name_new_city = $(this).text();
81    	    	
82    	ymaps.geocode(name_new_city, { results: 1 }).then(function (res) 
83		{
84	        var NextGeoObject = res.geoObjects.get(0);
85	        var new_coords = NextGeoObject.geometry.getCoordinates();
86	        
87	        myMap.setCenter(new_coords);
88	        myMap.setZoom(10);
89	        //changeCountRestaurants(name_new_city);
90		});
91	});
92        
93   /* function changeCountRestaurants(city_name)
94    {
95    	$.ajax({
96			type: "POST",
97			url: rootPath + "views/ajax/counter-restaurant.php",
98			dataType: "html",
99			data: "city=" + city_name,
100			success: function(data)
101			{
102				$("div.geography span.number-rest").text(data);
103			}
104		});
105    }*/
106    
107});

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.