1(()=>{ 2 3 var map; 4 var marker = []; 5 var infoWindow = []; 6 var markerData = []; 7 var currentWindow = null; 8 let i = 0; 9 10 const markerDataElement = document.querySelectorAll('.markerDataElement'); 11 const markerDataElementLength = markerDataElement.length; 12 13 markerDataElement.forEach( item => { 14 const carshareStationName = item.querySelector('.carshareStationName'); 15 const stationText = carshareStationName.innerHTML; 16 17 const carshareStationUrl = item.querySelector('.carshareStationUrl'); 18 const stationUrl = carshareStationUrl.getAttribute('href'); 19 20 21 const carshareStationAddress = item.querySelector('.carshareStationAddress'); 22 const addressText = carshareStationAddress.innerHTML; 23 const addressTextReplace = addressText.replace(/<br>/g,''); 24 25 const latitudeNumText = item.querySelector('.latitude_Num'); 26 const latitudeNum = Number(latitudeNumText.innerHTML); 27 28 const longitudeNumText = item.querySelector('.longitude_Num'); 29 const longitudeNum = Number(longitudeNumText.innerHTML); 30 31 const markerDataObj = { 32 id: '', 33 name: '', 34 address: '', 35 url: '', 36 icon: '/assets/img/carshare/icon_pin.png' 37 }; 38 39 markerDataObj.name = stationText; 40 markerDataObj.url = stationUrl; 41 markerDataObj.address = addressTextReplace; 42 markerDataObj.lat = latitudeNum; 43 markerDataObj.lng = longitudeNum; 44 45 markerData.push(markerDataObj); 46 47 i = i + 1; 48 49 if( i === markerDataElementLength){ 50 51 console.log(markerData); 52 53 function googleMap() { 54 55 var mapLatLng = new google.maps.LatLng(34.39427234976081, 132.50224013798208); 56 57 var myOptions = { 58 zoom: 10, 59 center: mapLatLng, 60 mapTypeControl: false, 61 fullscreenControl: false, 62 streetViewControl: false, 63 mapTypeControlOptions: { mapTypeIds: ['style', google.maps.MapTypeId.SATELLITE] } 64 }; 65 66 var map = new google.maps.Map(document.getElementById('gmap'), myOptions); 67 var icon = new google.maps.MarkerImage('/assets/img/carshare/icon_pin.png', 68 new google.maps.Size(27, 48), 69 new google.maps.Point(0,0) 70 ); 71 72 var icon = new google.maps.MarkerImage('/assets/img/carshare/icon_pin.png', 73 new google.maps.Size(27, 48), 74 new google.maps.Point(0,0) 75 ); 76 77 for (var i = 0; i < markerData.length; i++) { 78 markerLatLng = new google.maps.LatLng({ 79 lat: markerData[i]['lat'], lng: markerData[i]['lng'] 80 }); 81 marker[i] = new google.maps.Marker({ 82 position: markerLatLng, 83 map: map, 84 title: markerData[i]['name'], 85 animation: google.maps.Animation.DROP 86 }); 87 marker[i].setOptions({ 88 icon: { 89 url: markerData[i]['icon'] 90 }, 91 }); 92 infoWindow[i] = new google.maps.InfoWindow({ 93 content: '<div class="babble"><h2><a href="' + markerData[i]['url'] + '">' + markerData[i]['name'] + '</a></h2>\n<h3>'+markerData[i]['address']+'</h3></div>' 94 // content: '<div class="babble"><h2><a href="/carshare/' + markerData[i]['id'] + '.html">' + markerData[i]['name'] + '</a></h2>\n<h3>'+markerData[i]['address']+'</h3>\n<p><a href="tel:'+markerData[i]['phone0']+markerData[i]['phone1']+markerData[i]['phone2']+'">'+markerData[i]['phone0']+'-'+markerData[i]['phone1']+'-'+markerData[i]['phone2']+'</a></p></div>' 95 }); 96 markerEvent(i); 97 } 98 99 var styleOptions = [ 100 { 101 "elementType": "geometry", 102 "stylers": [ 103 { 104 "color": "#f6f6f6" 105 } 106 ] 107 }, 108 { 109 "elementType": "geometry.stroke", 110 "stylers": [ 111 { 112 "color": "#c3c3c3" 113 }, 114 { 115 "lightness": -10 116 } 117 ] 118 }, 119 // { 120 // "featureType": "administrative.land_parcel", 121 // "stylers": [ 122 // { 123 // "visibility": "off" 124 // } 125 // ] 126 // }, 127 // { 128 // "featureType": "administrative.neighborhood", 129 // "stylers": [ 130 // { 131 // "visibility": "off" 132 // } 133 // ] 134 // }, 135 // { 136 // "featureType": "poi", 137 // "elementType": "labels.text", 138 // "stylers": [ 139 // { 140 // "visibility": "off" 141 // } 142 // ] 143 // }, 144 { 145 "featureType": "road", 146 "elementType": "labels", 147 "stylers": [ 148 { 149 "visibility": "off" 150 } 151 ] 152 }, 153 { 154 "featureType": "road.arterial", 155 "stylers": [ 156 { 157 "color": "#ffffff" 158 } 159 ] 160 }, 161 { 162 "featureType": "road.highway", 163 "stylers": [ 164 { 165 "color": "#d0dce3" 166 } 167 ] 168 }, 169 { 170 "featureType": "road.highway", 171 "elementType": "geometry.stroke", 172 "stylers": [ 173 { 174 "color": "#d0dce3" 175 } 176 ] 177 }, 178 { 179 "featureType": "road.local", 180 "stylers": [ 181 { 182 "color": "#ffffff" 183 } 184 ] 185 }, 186 { 187 "featureType": "transit.line", 188 "elementType": "labels.text.fill", 189 "stylers": [ 190 { 191 "color": "#747474" 192 } 193 ] 194 }, 195 { 196 "featureType": "transit.station", 197 "elementType": "labels.text.fill", 198 "stylers": [ 199 { 200 "color": "#747474" 201 } 202 ] 203 }, 204 // { 205 // "featureType": "transit.station.airport", 206 // "stylers": [ 207 // { 208 // "visibility": "off" 209 // } 210 // ] 211 // }, 212 { 213 "featureType": "transit.station.rail", 214 "elementType": "labels.text.fill", 215 "stylers": [ 216 { 217 "color": "#747474" 218 } 219 ] 220 }, 221 { 222 "featureType": "water", 223 "stylers": [ 224 { 225 "color": "#dbe5ea" 226 }, 227 { 228 "weight": 1 229 } 230 ] 231 }, 232 // { 233 // "featureType": "water", 234 // "elementType": "labels.text", 235 // "stylers": [ 236 // { 237 // "visibility": "off" 238 // } 239 // ] 240 // } 241 ]; 242 var styledMapOptions = { name: 'ãã¤ããåºå³¶ ã¹ãã¼ã·ã§ã³ä¸è¦§' }; 243 var myMapType = new google.maps.StyledMapType(styleOptions, styledMapOptions); 244 map.mapTypes.set('style', myMapType); 245 map.setMapTypeId('style'); 246 247 }; 248 249 function markerEvent(i) { 250 marker[i].addListener('click', function() { 251 if (currentWindow) { 252 currentWindow.close(); 253 } 254 infoWindow[i].open(map, marker[i]); 255 currentWindow = infoWindow[i]; 256 }); 257 } 258 google.maps.event.addDomListener(window, 'load', function() { 259 googleMap(); 260 }); 261 google.maps.event.addDomListener(window, 'resize', function() { 262 googleMap(); 263 }); 264 } 265 266 }); 267 268 269})();
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.