PageSourceSearch

https://unagino-nedoko.net/wp/wp-content/themes/unagino-nedoko9/js/gmap-event.js

js unagino-nedoko.net collected 2026-10-02 10:15:15 UTC 2,779 bytes, 112 lines download raw bytes

1(function($){
2function new_map($el){
3	var $markers = $el.find('.marker');
4	var args = {
5		zoom : 13,
6		center : new google.maps.LatLng(0,0),
7		scrollwheel: false,
8		fullscreenControl: false,
9		mapTypeControl: false,
10		streetViewControl: false,
11		mapTypeId: google.maps.MapTypeId.ROADMAP,
12		styles: [{
13	    "elementType": "geometry.fill",
14	    "stylers": [{"saturation": -100}]
15	  },{
16	    "elementType": "geometry.stroke",
17	    "stylers": [{"saturation": -100}]
18	  },{
19	    "elementType": "labels.icon",
20	    "stylers": [{"saturation": -100}]
21	  },{
22	    "elementType": "labels.text",
23	    "stylers": [{"saturation": -100}]
24	  },{
25	    "elementType": "labels.text.fill",
26	    "stylers": [{"saturation": -100}]
27	  },{
28	    "elementType": "labels.text.stroke",
29	    "stylers": [{"saturation": -100}]
30	  },{
31	    "featureType": "road.arterial",
32	    "elementType": "labels",
33	    "stylers": [{"visibility": "off"}]
34	  },{
35	    "featureType": "road.highway",
36	    "elementType": "labels",
37	    "stylers": [{"visibility": "off"}]
38	  },{
39	    "featureType": "road.local",
40	    "stylers": [{"visibility": "off"}]
41	  }]
42	};
43	var map = new google.maps.Map( $el[0], args);
44	map.markers = [];
45	$markers.each(function(){ add_marker($(this), map); });
46	center_map(map);
47	return map;
48}
49
50var currentInfoWindow = null;
51
52function add_marker($marker, map){
53	var latlng = new google.maps.LatLng( $marker.attr('data-lat'), $marker.attr('data-lng'));
54	var marker = new google.maps.Marker({
55		position: latlng,
56		map: map,
57		icon: image = {
58			url: '/wp/wp-content/themes/unagino-nedoko/img/share/gmap-pin.png',
59			scaledSize: new google.maps.Size(24,42),
60			anchor: new google.maps.Point(12,42)
61		}
62	});
63
64	map.markers.push(marker);
65
66	if($marker.html()){
67		var infowindow = new google.maps.InfoWindow({
68			content: $marker.html()
69		});
70
71		google.maps.event.addListener(marker, 'click', function(){
72			if(currentInfoWindow){
73				currentInfoWindow.close();
74			}
75			infowindow.open(map, marker);
76			currentInfoWindow = infowindow;
77
78			// 情報ウィンドウカスタマイズ
79			var iw = $('.gm-style-iw');
80			var iwWrap = iw.parent();
81			var iwBackground = iw.prev();
82			var iwClose = iw.next();
83			iwWrap.addClass("iw-wrap");
84			iwBackground.css({'display': 'none'});
85			iwClose.addClass("btn-close");
86		});
87	}
88}
89
90function center_map(map){
91	var bounds = new google.maps.LatLngBounds();
92	$.each(map.markers, function(i, marker){
93		var latlng = new google.maps.LatLng( marker.position.lat(), marker.position.lng());
94		bounds.extend(latlng);
95	});
96	if(map.markers.length == 1){
97		map.setCenter(bounds.getCenter());
98		map.setZoom(13);
99	}else{
100		map.fitBounds(bounds);
101	}
102}
103
104var map = null;
105
106$(document).ready(function(){
107	$('#event-map').each(function(){
108		map = new_map($(this));
109	});
110});
111
112})(jQuery);

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.