1var map; 2var marker; 3var latitude; 4var longitude; 5 6function initialize() { 7 if (document.getElementById('map-canvas')) { 8 var myLatlng = new google.maps.LatLng(latitude, longitude); 9 var mapOptions = { 10 zoom: 15, 11 center: myLatlng 12 }; 13 map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); 14 15 marker = new google.maps.Marker({ 16 position: myLatlng, 17 map: map, 18 title: 'Compacc Complete Accountancy' 19 }); 20 } 21 22} 23 24/** 25 * Update the marker position & show the proper content below the map. 26 * 27 * @param id 28 * @param marker 29 * @param lat 30 * @param long 31 */ 32function updateContent(id, marker, lat, long) { 33 // Update is-active class in menu 34 document.querySelector('.c-locator__item.is-active').classList.remove('is-active'); 35 event.target.parentNode.classList.add('is-active'); 36 37 // Remove is-active class. 38 document.getElementsByClassName("c-locator__place is-active")[0].classList.remove('is-active'); 39 40 // Show the proper content. 41 document.getElementById(id).classList.add('is-active'); 42 43 // Add new marker. 44 var latlng = new google.maps.LatLng(lat, long); 45 marker.setPosition(latlng); 46 // Center the map on the marker. 47 map.panTo(marker.getPosition()); 48} 49 50 51google.maps.event.addDomListener(window, 'load', initialize);
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.