var initMaps = function(){}; var zoomto = function(){}; var navto = function(){}; var map; var mapcanvas; (function($){ mapcanvas = $('.map-canvas')[0]; if (!mapcanvas) return; /* var center = {lat: 39.8836914, lng: -96.9561384}, zoom = 4, mobilezoom = 3, mapTypeId = 'terrain', infoWindows = []; */ var center = {lat: 40.3626633, lng: -56.3617780}, zoom = 3.25, mobilezoom = 1.75, mapTypeId = 'terrain', infoWindows = []; function closeAllInfoWindows(w) { for (var i=0; i < infoWindows.length; i++) { if (w !== infoWindows[i]) { infoWindows[i].close(); infoWindows[i].cml_opened = false; } } } function loadMaps() { var script = document.createElement('script'); script.type = 'text/javascript'; script.async = true; script.defer = true; script.src = 'https://maps.googleapis.com/maps/api/js?' + '&key=AIzaSyB_G_9AjmYfum0S74ryBOsIE1HlMVkHBC8&libraries=places&callback=initMaps'; document.body.appendChild(script); } function ResetControl(controlDiv, map) { var controlUI = document.createElement('div'); controlUI.className = 'gm-style-mtc'; controlUI.title = 'Click to reset the map'; controlDiv.appendChild(controlUI); var controlText = document.createElement('div'); controlText.className = 'custom-control'; controlText.innerHTML = 'Reset Map'; controlUI.appendChild(controlText); controlUI.addEventListener('click', function() { map.setCenter(center); map.setZoom( Foundation.MediaQuery.is('small only') ? mobilezoom : zoom ); map.setMapTypeId(mapTypeId); //google.maps.event.trigger(map, 'resize'); if(dataLayer !== undefined && dataLayer !== null) { dataLayer.push({'event': 'gaTriggerEvent', 'gaEventCategory': 'Map', 'gaEventAction': 'Reset', 'gaEventLabel': ''}); } }); } initMaps = function() { google.maps.InfoWindow.prototype.cml_opened = false; var open_iw = parseInt(mapcanvas.dataset.iw), pid = parseInt(mapcanvas.dataset.pid), balaMarker, balaIW, balaOffset = new google.maps.Size(-10, 0), zeroOffset = new google.maps.Size(0, 0); map = new google.maps.Map( mapcanvas, { center: center, zoom: (Foundation.MediaQuery.is('small only') ? mobilezoom : zoom), mapTypeId: mapTypeId, disableDefaultUI: true, zoomControl: true, mapTypeControl: true, scaleControl: true, streetViewControl: false, rotateControl: true, fullscreenControl: true, gestureHandling: "cooperative", styles: [ { "featureType": "administrative.land_parcel", "stylers": [ { "visibility": "off" } ] }, { "featureType": "administrative.neighborhood", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "stylers": [ { "visibility": "off" } ] }, { "featureType": "poi", "elementType": "labels.text", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road", "elementType": "labels", "stylers": [ { "visibility": "off" } ] }, { "featureType": "road", "elementType": "labels.icon", "stylers": [ { "visibility": "off" } ] }, { "featureType": "transit", "stylers": [ { "visibility": "off" } ] }, { "featureType": "water", "elementType": "labels.text", "stylers": [ { "visibility": "off" } ] } ] }); var resetControlDiv = document.createElement('div'); resetControlDiv.className = 'gmnoprint custom-control-container'; var resetControl = new ResetControl(resetControlDiv, map); resetControlDiv.index = 1; map.controls[google.maps.ControlPosition.TOP_LEFT].push(resetControlDiv); zoomto = function(azoom) { map.setCenter({ lat: parseFloat(azoom.dataset.lat), lng: parseFloat(azoom.dataset.lng) }); map.setZoom(1); map.setZoom(parseFloat(azoom.dataset.zoom)); map.setMapTypeId('satellite'); if(dataLayer !== undefined && dataLayer !== null) { dataLayer.push({'event': 'gaTriggerEvent', 'gaEventCategory': 'Map', 'gaEventAction': 'Zoom', 'gaEventLabel': azoom.dataset.title}); } } navto = function(anav) { if(dataLayer !== undefined && dataLayer !== null) { dataLayer.push({'event': 'gaTriggerEvent', 'gaEventCategory': 'Map', 'gaEventAction': 'Link', 'gaEventLabel': anav.dataset.title}); } return; } var iconBase = 'https://www.dicalite.com/wp-content/themes/dicalite2023/img/map/'; var icons = { pin_default: { icon: { url: iconBase + 'pin_default.png', size: new google.maps.Size(26, 36), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 36) } }, pin_dicalite: { icon: { url: iconBase + 'pin_dicalite.png', size: new google.maps.Size(26, 36), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 36) } }, pin_dicaperl: { icon: { url: iconBase + 'pin_dicaperl.png', size: new google.maps.Size(26, 36), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 36) } }, pin_spvcorp: { icon: { url: iconBase + 'pin_spvcorp.png', size: new google.maps.Size(26, 36), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(13, 36) } }, mine_default: { icon: { url: iconBase + 'mine_default.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, mine_dicalite: { icon: { url: iconBase + 'mine_dicalite.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, mine_dicaperl: { icon: { url: iconBase + 'mine_dicaperl.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, mine_spvcorp: { icon: { url: iconBase + 'mine_spvcorp.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, furnace_default: { icon: { url: iconBase + 'furnace_default.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, furnace_dicalite: { icon: { url: iconBase + 'furnace_dicalite.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, furnace_dicaperl: { icon: { url: iconBase + 'furnace_dicaperl.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, furnace_spvcorp: { icon: { url: iconBase + 'furnace_spvcorp.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, office_default: { icon: { url: iconBase + 'office_default.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, office_dicalite: { icon: { url: iconBase + 'office_dicalite.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, office_dicaperl: { icon: { url: iconBase + 'office_dicaperl.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, office_spvcorp: { icon: { url: iconBase + 'office_spvcorp.png', size: new google.maps.Size(30, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(15, 14) } }, office_bala: { icon: { url: iconBase + 'office_bala.png', size: new google.maps.Size(50, 30), origin: new google.maps.Point(0, 0), anchor: new google.maps.Point(50, 14) } }, }; var locations = [ { position: new google.maps.LatLng(37.995054, -118.213005), pin: "mine_dicalite", title: "Basalt, NV", info: "