1/* global mmm_maps, mmm_localize */ 2 3var map; 4 5/** 6 * Init google map api 7 */ 8(function () { 9 for (var i = 0; i < mmm_maps.length; i++) { 10 map = new google.maps.Map(document.getElementById('map-multi-marker-' + mmm_maps[i].map_id), mmm_maps[i].map_option); 11 infoWindow = new google.maps.InfoWindow(); 12 // Close event 13 google.maps.event.addListener(map, 'click', function () { 14 infoWindow.close(); 15 }); 16 // Resize event 17 window.onresize = function () { 18 var center = map.getCenter(); 19 google.maps.event.trigger(map, "resize"); 20 map.setCenter(center); 21 }; 22 // Set markers 23 var markers = mmm_maps[i].markers; 24 for (var j = 0; j < markers.length; j++) { 25 set_markers(markers[j].id, new google.maps.LatLng(markers[j].lat, markers[j].lng), markers[j].icon); 26 } 27 } 28}()); 29 30/** 31 * Set markers 32 * @param id 33 * @param latLng 34 * @param icon 35 */ 36function set_markers(id, latLng, icon) { 37 var marker = new google.maps.Marker({ 38 position: latLng, 39 map: map, 40 icon: icon 41 }); 42 // Event click 43 google.maps.event.addListener(marker, 'click', function () { 44 // Open tooltip 45 infoWindow.open(map, marker); 46 //Add loader 47 infoWindow.setContent('<div id="infobulle"><div class="loader-marker-c" style="padding: 30px 20px 30px 40px;text-align:center;"><i class="fa fa-refresh fa-spin fa-3x fa-fw" style="color:#C7C7C7;"></i><span class="sr-only"></span></div></div>'); 48 // Async request 49 var xhr = new XMLHttpRequest(); 50 xhr.open('POST', mmm_localize.ajax_url, true); 51 xhr.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded; charset=UTF-8'); 52 xhr.send('action=mmm_async_content_marker&id=' + id); 53 xhr.onload = function () { 54 if (xhr.status >= 200 && xhr.status < 400) { 55 // Success! 56 var response = xhr.responseText; 57 infoWindow.setContent('<div id="infobulle">' + response + '</div>'); 58 } 59 }; 60 }); 61}
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.