{"version":3,"sources":["webpack:///./Scripts/googlemaps.js"],"names":["queryString","require","merc","element","getMarkers","markers","undefined","result","Array","isArray","forEach","splitString","split","iconUrl","iconSize","iconScale","locations","url","marker","indexOf","p","substring","anchor","parts","length","parseInt","window","navigator","userAgent","match","replace","RegExp","latlng","push","lat","parseFloat","lng","icon","size","scale","initGoogleMapsScript","filename","fileref","document","createElement","setAttribute","initGoogleMaps","allsuspects","getElementsByTagName","i","getAttribute","parentNode","replaceChild","appendChild","parameters","hasAttribute","parseUrl","query","src","currentStyle","getComputedStyle","backgroundImage","slice","canvas","context","getContext","images","markerImages","mapMarkers","mapArea","center","mapPos","fromLatLngToPoint","redrawTimeout","imageSmoothingQuality","mozImageSmoothingEnabled","webkitImageSmoothingEnabled","msImageSmoothingEnabled","imageSmoothingEnabled","redrawCanvas","timeout","clearTimeout","setTimeout","rect","getBoundingClientRect","rectWidth","right","left","rectHeight","bottom","top","width","height","rect1","rect2","updated","tileCount","Math","ceil","drawImg","img","x","y","dx","round","dy","drawImage","index","Image","crossOrigin","addEventListener","wx","pow","zoom","wy","newCenter","fromPointToLatLng","stringify","location","markerPos","style","toDataURL","reloadMarkers","mapMarker","sort","a","b","aPos","bPos","markersquery","markersinput","querySelector","readMarkersData","value","display","decodeURIComponent","createStaticMap","position","el","this","language","key","parent","newTarget","opacity","transition","elementButton","insertBefore","nextSibling","map","google","maps","Map","draggable","styles","featureType","elementType","stylers","visibility","reloadMapMarkers","m","setMap","Marker","LatLng","scaledSize","Size","Point","event","addListener","href","MarkerClusterer","imagePath","lenght","initial","getZoom","addListenerOnce","init","Googlemaps"],"mappings":"0FAAA,mBAEA,MAAMA,EAAcC,EAAQ,IACtBC,EAAOD,EAAQ,IAENE,cA4dd,IA3diB,SAAUA,GAC1B,IAOIC,EAAa,SAAUC,GAC1B,GAAeC,MAAXD,EACH,MAAO,GAER,IAAIE,EAAS,GAiEb,OA/DIC,MAAMC,QAAQJ,GACFA,EAEA,CAACA,IAEJK,SAAQ,SA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r\n\r\nconst queryString = require('query-string');\r\nconst merc = require('mercator-projection');\r\n\r\nexport default element => {\r\n\tvar GoogleMaps = function (element) {\r\n\t\tvar isIe = function () {\r\n\t\t\tif (window.navigator.userAgent.indexOf(\"MSIE \") > 0 || navigator.userAgent.match(/Trident.*rv\\:11\\./))\r\n\t\t\t\treturn true;\r\n\r\n\t\t\treturn false;\r\n\t\t};\r\n\r\n\t\tvar getMarkers = function (markers) {\r\n\t\t\tif (markers == undefined)\r\n\t\t\t\treturn [];\r\n\r\n\t\t\tvar result = [];\r\n\t\t\tvar markersArray = [];\r\n\t\t\tif (Array.isArray(markers))\r\n\t\t\t\tmarkersArray = markers;\r\n\t\t\telse\r\n\t\t\t\tmarkersArray = [markers];\r\n\r\n\t\t\tmarkersArray.forEach(function (markers) {\r\n\t\t\t\tvar splitString = markers.split('|');\r\n\t\t\t\tvar iconUrl = \"\";\r\n\t\t\t\tvar iconSize = 128;\r\n\t\t\t\tvar iconScale = 1.0;\r\n\t\t\t\tvar locations = [];\r\n\t\t\t\tvar url = \"\";\r\n\r\n\t\t\t\tsplitString.forEach(function (marker) {\r\n\t\t\t\t\tif (marker.indexOf('icon:') !== -1) {\r\n\t\t\t\t\t\ticonUrl = marker.substring(5);\r\n\r\n\t\t\t\t\t\tvar p = iconUrl.indexOf('#');\r\n\t\t\t\t\t\tif (p !== -1) {\r\n\t\t\t\t\t\t\tvar anchor = iconUrl.substring(p + 1);\r\n\t\t\t\t\t\t\ticonUrl = iconUrl.substring(0, p);\r\n\r\n\t\t\t\t\t\t\tvar parts = anchor.split(';');\r\n\t\t\t\t\t\t\tif (parts.length == 2)\r\n\t\t\t\t\t\t\t\ticonScale = parseInt(parts[0]) / parseInt(parts[1]);\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (isIe())\r\n\t\t\t\t\t\t\ticonUrl = \"/convertsvg/\" + iconUrl.replace(new RegExp(\"/\", 'g'), \"|\");\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t\tif (marker.indexOf('url:') !== -1) {\r\n\t\t\t\t\t\t\turl = marker.substring(4);\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tif (marker.indexOf('size:') !== -1) {\r\n\t\t\t\t\t\t\t\tswitch (marker.substring(5)) {\r\n\t\t\t\t\t\t\t\t\tcase \"small\":\r\n\t\t\t\t\t\t\t\t\t\ticonSize = 32;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t\t\tcase \"normal\":\r\n\t\t\t\t\t\t\t\t\t\ticonSize = 128;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"tiny\":\r\n\t\t\t\t\t\t\t\t\t\ticonSize = 16;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t\tcase \"mid\":\r\n\t\t\t\t\t\t\t\t\t\ticonSize = 64;\r\n\t\t\t\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tif (marker.indexOf(':') == -1) {\r\n\t\t\t\t\t\t\t\t\t// Split coordinates\r\n\t\t\t\t\t\t\t\t\tvar latlng = marker.split(\",\");\r\n\t\t\t\t\t\t\t\t\tlocations.push({ lat: parseFloat(latlng[0]), lng: parseFloat(latlng[1]) });\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t});\r\n\r\n\t\t\t\tresult.push({ locations: locations, icon: iconUrl, size: iconSize, scale: iconScale, url: url });\r\n\t\t\t});\r\n\r\n\t\t\treturn result;\r\n\t\t}\r\n\r\n\t\tvar createStaticMap = function (element, markers, parameters) {\r\n\t\t\tvar canvas = document.createElement('canvas');\r\n\t\t\tvar context = canvas.getContext('2d');\r\n\t\t\tvar images = {};\r\n\t\t\tvar markerImages = {};\r\n\t\t\tvar mapMarkers = [];\r\n\t\t\tvar mapArea = { left: 0, top: 0, right: 640, bottom: 600, width: 640, height: 600 };\r\n\t\t\tvar center = parameters.center.split(\",\");\r\n\t\t\tvar mapPos = merc.fromLatLngToPoint({ lat: center[0], lng: center[1] });\r\n\t\t\tvar redrawTimeout = 0;\r\n\r\n\t\t\tparameters.scale = 1;\r\n\r\n\t\t\tcontext.imageSmoothingQuality = \"medium\";\r\n\t\t\tcontext.mozImageSmoothingEnabled = true;\r\n\t\t\tcontext.webkitImageSmoothingEnabled = true;\r\n\t\t\tcontext.msImageSmoothingEnabled = true;\r\n\t\t\tcontext.imageSmoothingEnabled = true;\r\n\r\n\t\t\tvar aabb = function (rect1, rect2) {\r\n\t\t\t\treturn (rect1.left < rect2.left + rect2.width && rect1.left + rect1.width > rect2.left && rect1.top < rect2.top + rect2.height && rect1.top + rect1.height > rect2.top);\r\n\t\t\t}\r\n\r\n\t\t\tvar redrawCanvas = function (timeout) {\r\n\t\t\t\tif (redrawTimeout != 0)\r\n\t\t\t\t\tclearTimeout(redrawTimeout);\r\n\r\n\t\t\t\tredrawTimeout = setTimeout(function () {\r\n\t\t\t\t\tredrawTimeout = 0;\r\n\r\n\t\t\t\t\tvar rect = element.getBoundingClientRect();\r\n\t\t\t\t\tvar rectWidth = rect.right - rect.left;\r\n\t\t\t\t\tvar rectHeight = rect.bottom - rect.top;\r\n\r\n\t\t\t\t\tcanvas.width = rectWidth;\r\n\t\t\t\t\tcanvas.height = rectHeight;\r\n\r\n\t\t\t\t\tvar updated = false;\r\n\t\t\t\t\tvar tileCount = { x: Math.ceil((rectWidth / 2) / (mapArea.width / 2)), y: Math.ceil((rectHeight / 2) / (mapArea.height / 2)) };\r\n\t\t\t\t\tvar drawImg = function (img, x, y) {\r\n\t\t\t\t\t\tvar dx = Math.round(((x * mapArea.width) - (mapArea.width / 2)) + (rectWidth / 2) - ((640 - mapArea.width) / 2));\r\n\t\t\t\t\t\tvar dy = Math.round(((y * mapArea.height) - (mapArea.height / 2)) + (rectHeight / 2) - ((640 - mapArea.height) / 2));\r\n\t\t\t\t\t\tcontext.drawImage(img, mapArea.left, mapArea.top, mapArea.right, mapArea.bottom, Math.round(dx), Math.round(dy), Math.round(mapArea.width), Math.round(mapArea.height));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tvar drawMarkers = function () {\r\n\t\t\t\t\t\tmapMarkers.forEach(function (marker) {\r\n\t\t\t\t\t\t\tvar img = markerImages[marker.icon];\r\n\t\t\t\t\t\t\tif (img.width == 0 || img.height == 0)\r\n\t\t\t\t\t\t\t\treturn;\r\n\r\n\t\t\t\t\t\t\tvar location = marker.location;\r\n\t\t\t\t\t\t\tvar wx = mapPos.x * Math.pow(2, parseInt(parameters.zoom));\r\n\t\t\t\t\t\t\tvar wy = mapPos.y * Math.pow(2, parseInt(parameters.zoom));\r\n\r\n\t\t\t\t\t\t\tvar markerPos = merc.fromLatLngToPoint(location);\r\n\t\t\t\t\t\t\tvar mx = markerPos.x * Math.pow(2, parseInt(parameters.zoom));\r\n\t\t\t\t\t\t\tvar my = markerPos.y * Math.pow(2, parseInt(parameters.zoom));\r\n\r\n\t\t\t\t\t\t\tvar x = wx - mx;\r\n\t\t\t\t\t\t\tvar y = wy - my;\r\n\t\t\t\t\t\t\tvar width = marker.size * (marker.scale < 1.0 ? marker.scale : 1.0);\r\n\t\t\t\t\t\t\tvar height = marker.size / (marker.scale > 1.0 ? marker.scale : 1.0);\r\n\r\n\t\t\t\t\t\t\tcontext.drawImage(img, 0, 0, img.width, img.height, Math.round((rectWidth / 2) - x - (width / 2)), Math.round((rectHeight / 2) - y - height), Math.round(width), Math.round(height));\r\n\t\t\t\t\t\t});\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tfor (var y = -tileCount.y; y <= tileCount.y; y++) {\r\n\t\t\t\t\t\tfor (var x = -tileCount.x; x <= tileCount.x; x++) {\r\n\t\t\t\t\t\t\tvar r1 = {\r\n\t\t\t\t\t\t\t\tleft: 0,\r\n\t\t\t\t\t\t\t\ttop: 0,\r\n\t\t\t\t\t\t\t\twidth: rectWidth,\r\n\t\t\t\t\t\t\t\theight: rectHeight\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\tvar r2 = {\r\n\t\t\t\t\t\t\t\tleft: ((x * mapArea.width) - (mapArea.width / 2)) + (rectWidth / 2) - ((640 - mapArea.width) / 2),\r\n\t\t\t\t\t\t\t\ttop: ((y * mapArea.height) - (mapArea.height / 2)) + (rectHeight / 2) - ((640 - mapArea.height) / 2),\r\n\t\t\t\t\t\t\t\twidth: mapArea.width,\r\n\t\t\t\t\t\t\t\theight: mapArea.height\r\n\t\t\t\t\t\t\t};\r\n\r\n\t\t\t\t\t\t\tif (!aabb(r1, r2))\r\n\t\t\t\t\t\t\t\tcontinue;\r\n\r\n\t\t\t\t\t\t\tvar img;\r\n\t\t\t\t\t\t\tvar index = x + \",\" + y;\r\n\t\t\t\t\t\t\tif (typeof images[index] == \"undefined\") {\r\n\t\t\t\t\t\t\t\timages[index] = img = new Image();\r\n\t\t\t\t\t\t\t\timg.crossOrigin = 'anonymous';\r\n\t\t\t\t\t\t\t\timg.addEventListener('load', function () { redrawCanvas(100); }, false);\r\n\r\n\t\t\t\t\t\t\t\tvar wx = mapPos.x * Math.pow(2, parseInt(parameters.zoom));\r\n\t\t\t\t\t\t\t\tvar wy = mapPos.y * Math.pow(2, parseInt(parameters.zoom));\r\n\t\t\t\t\t\t\t\tvar newCenter = merc.fromPointToLatLng({ x: (wx + (x * mapArea.width)) / Math.pow(2, parseInt(parameters.zoom)), y: (wy + (y * mapArea.height)) / Math.pow(2, parseInt(parameters.zoom)) })\r\n\t\t\t\t\t\t\t\tparameters.center = newCenter.lat + \",\" + newCenter.lng;\r\n\r\n\t\t\t\t\t\t\t\tif (x == 0 && y == 0)\r\n\t\t\t\t\t\t\t\t\tcenter = [newCenter.lat, newCenter.lng];\r\n\r\n\t\t\t\t\t\t\t\timg.src = \"https://maps.google.com/maps/api/staticmap?\" + queryString.stringify(parameters);\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\tdrawImg(images[index], x, y);\r\n\t\t\t\t\t\t\t\tupdated = true;\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif (updated) {\r\n\t\t\t\t\t\tdrawMarkers();\r\n\t\t\t\t\t\telement.style.backgroundImage = \"url(\\\"\" + canvas.toDataURL('image/jpeg', 1.0) + \"\\\")\";\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tparameters.center = center[0] + \",\" + center[1];\r\n\t\t\t\t}, timeout);\r\n\t\t\t}\r\n\r\n\t\t\tvar reloadMarkers = function (markers) {\r\n\t\t\t\tmapMarkers = [];\r\n\t\t\t\tmarkers.forEach(function (marker) {\r\n\t\t\t\t\tif (typeof markerImages[marker.icon] == \"undefined\") {\r\n\t\t\t\t\t\tvar img = markerImages[marker.icon] = new Image();\r\n\t\t\t\t\t\timg.crossOrigin = 'anonymous';\r\n\t\t\t\t\t\timg.addEventListener('load', function () { redrawCanvas(100); }, false);\r\n\t\t\t\t\t\timg.src = marker.icon;\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tmarker.locations.forEach(function (location) {\r\n\t\t\t\t\t\tvar mapMarker = {\r\n\t\t\t\t\t\t\tlocation: location,\r\n\t\t\t\t\t\t\tsize: marker.size,\r\n\t\t\t\t\t\t\tscale: marker.scale,\r\n\t\t\t\t\t\t\ticon: marker.icon\r\n\t\t\t\t\t\t};\r\n\t\t\t\t\t\tmapMarkers.push(mapMarker);\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\r\n\t\t\t\tmapMarkers.sort(function (a, b) {\r\n\t\t\t\t\tvar aPos = merc.fromLatLngToPoint(a.location);\r\n\t\t\t\t\tvar bPos = merc.fromLatLngToPoint(b.location);\r\n\r\n\t\t\t\t\treturn aPos.y < bPos.y ? -1 : aPos.y > bPos.y ? 1 : aPos.x < bPos.x ? 1 : aPos.x > bPos.x ? -1 : 0;\r\n\t\t\t\t});\r\n\t\t\t\tredrawCanvas(10);\r\n\t\t\t}\r\n\r\n\t\t\tif (element.hasAttribute(\"data-markersquery\")) {\r\n\t\t\t\tvar markersquery = element.getAttribute(\"data-markersquery\");\r\n\t\t\t\tif (markersquery != \"\") {\r\n\t\t\t\t\tvar markersinput = document.querySelector(markersquery);\r\n\t\t\t\t\tif (markersinput != undefined) {\r\n\t\t\t\t\t\tvar readMarkersData = function () {\r\n\t\t\t\t\t\t\tif (markersinput.value != \"\" && element.style.display != \"none\") {\r\n\t\t\t\t\t\t\t\tvar parts = markersinput.value.split(\"&\");\r\n\t\t\t\t\t\t\t\tfor (var i = 0; i < parts.length; i++)\r\n\t\t\t\t\t\t\t\t\tparts[i] = decodeURIComponent(parts[i]);\r\n\t\t\t\t\t\t\t\tif (parts.length > 0)\r\n\t\t\t\t\t\t\t\t\treloadMarkers(getMarkers(parts));\r\n\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\treloadMarkers([]);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\tmarkersinput.addEventListener(\"change\", readMarkersData);\r\n\r\n\t\t\t\t\t\tif (markers.length > 0)\r\n\t\t\t\t\t\t\treloadMarkers(markers);\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\treadMarkersData();\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\tdocument.addEventListener(\"DOMContentLoaded\", function () {\r\n\t\t\t\tredrawCanvas(500);\r\n\t\t\t});\r\n\r\n\t\t\twindow.addEventListener(\"resize\", function () {\r\n\t\t\t\tredrawCanvas(1000);\r\n\t\t\t});\r\n\t\t}\r\n\r\n\t\tvar init = function (element) {\r\n\t\t\tvar parameters = null;\r\n\r\n\t\t\tif (element.hasAttribute(\"data-googlemaps-url\")) {\r\n\t\t\t\t// Parse the Static Map arguments\r\n\t\t\t\tparameters = queryString.parseUrl(element.getAttribute(\"data-googlemaps-url\")).query;\r\n\t\t\t} else {\r\n\t\t\t\t// Get element styles\r\n\t\t\t\tvar styles = element.currentStyle || window.getComputedStyle(element, false);\r\n\r\n\t\t\t\t// Get background image source\r\n\t\t\t\tvar src = styles.backgroundImage.slice(4, -1).replace(/\"/g, \"\");\r\n\r\n\t\t\t\t// Parse the Static Map QueryString\r\n\t\t\t\tparameters = queryString.parseUrl(src).query;\r\n\t\t\t}\r\n\r\n\t\t\tvar markers = getMarkers(parameters.markers);\r\n\t\t\tparameters.markers = null;\r\n\r\n\t\t\tcreateStaticMap(element, markers, parameters);\r\n\r\n\t\t\t// Set correct position for parent\r\n\t\t\tvar parent = element.parentNode;\r\n\t\t\tparent.style.position = 'relative';\r\n\t\t\t\r\n\t\t\t// Click Event for the Static Map\r\n\t\t\tif (!element.hasAttribute('data-static-map')) {\r\n\t\t\t\telement.addEventListener(\"click\", function () {\r\n\t\t\t\t\tvar el = this;\r\n\r\n\t\t\t\t\t// Initialize or reload Google Maps\r\n\t\t\t\t\tvar gmaps = initGoogleMaps('https://maps.googleapis.com/maps/api/js?callback=parseInt&language=' + parameters.language + '&key=' + parameters.key);\r\n\t\t\t\t\tgmaps.addEventListener('load', function () {\r\n\t\t\t\t\t\t// Old Target (Static Map)\r\n\t\t\t\t\t\tvar parent = el.parentNode;\r\n\t\t\t\t\t\tparent.style.position = 'relative';\r\n\r\n\t\t\t\t\t\t// New Target (Dynamic Map)\r\n\t\t\t\t\t\tvar newTarget = document.createElement(\"div\");\r\n\t\t\t\t\t\tnewTarget.width = el.width;\r\n\t\t\t\t\t\tnewTarget.height = el.height;\r\n\t\t\t\t\t\tnewTarget.style.position = 'absolute';\r\n\t\t\t\t\t\tnewTarget.style.left = 0;\r\n\t\t\t\t\t\tnewTarget.style.right = 0;\r\n\t\t\t\t\t\tnewTarget.style.top = 0;\r\n\t\t\t\t\t\tnewTarget.style.bottom = 0;\r\n\r\n\t\t\t\t\t\t// Replace Static with Dynamic\r\n\t\t\t\t\t\tnewTarget.style.opacity = 0;\r\n\t\t\t\t\t\tnewTarget.style.transition = \"opacity 0.5s\";\r\n\r\n\t\t\t\t\t\tvar elementButton = el.querySelector(\"button\");\r\n\t\t\t\t\t\telementButton.style.opacity = 1;\r\n\t\t\t\t\t\telementButton.style.transition = \"opacity 0.5s\";\r\n\t\t\t\t\t\tparent.insertBefore(newTarget, el.nextSibling);\r\n\r\n\t\t\t\t\t\t// Initialize Google Map\r\n\t\t\t\t\t\tvar center = [];\r\n\t\t\t\t\t\tif (typeof parameters.center != \"undefined\") {\r\n\t\t\t\t\t\t\tcenter = parameters.center.split(\",\");\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\tcenter.push(\"-34.397\");\r\n\t\t\t\t\t\t\tcenter.push(\"150.644\");\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tvar map = new google.maps.Map(newTarget, {\r\n\t\t\t\t\t\t\tcenter: {\r\n\t\t\t\t\t\t\t\tlat: parseFloat(center[0]),\r\n\t\t\t\t\t\t\t\tlng: parseFloat(center[1])\r\n\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\tzoom: parseInt(parameters.zoom),\r\n\t\t\t\t\t\t\tdraggable: true,\r\n\t\t\t\t\t\t\tstyles: [{\r\n\t\t\t\t\t\t\t\tfeatureType: 'all',\r\n\t\t\t\t\t\t\t\telementType: 'labels',\r\n\t\t\t\t\t\t\t\tstylers: [{\r\n\t\t\t\t\t\t\t\t\tvisibility: 'on'\r\n\t\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t\t}]\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t// Map markers\r\n\t\t\t\t\t\tvar mapMarkers = [];\r\n\t\t\t\t\t\tvar reloadMapMarkers = function (markers) {\r\n\t\t\t\t\t\t\tmapMarkers.forEach(function (m) {\r\n\t\t\t\t\t\t\t\tm.setMap(null);\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\tmapMarkers = [];\r\n\t\t\t\t\t\t\tmarkers.forEach(function (marker) {\r\n\t\t\t\t\t\t\t\tmarker.locations.forEach(function (location) {\r\n\t\t\t\t\t\t\t\t\tvar mapMarker = new google.maps.Marker({\r\n\t\t\t\t\t\t\t\t\t\tposition: new google.maps.LatLng(location.lat, location.lng),\r\n\t\t\t\t\t\t\t\t\t\tmap: map,\r\n\t\t\t\t\t\t\t\t\t\ticon: {\r\n\t\t\t\t\t\t\t\t\t\t\turl: marker.icon,\r\n\t\t\t\t\t\t\t\t\t\t\tscaledSize: new google.maps.Size(marker.size * (marker.scale < 1.0 ? marker.scale : 1.0), marker.size / (marker.scale > 1.0 ? marker.scale : 1.0)),\r\n\t\t\t\t\t\t\t\t\t\t\tanchor: new google.maps.Point(Math.round((marker.size * (marker.scale < 1.0 ? marker.scale : 1.0)) / 2), marker.size),\r\n\t\t\t\t\t\t\t\t\t\t},\r\n\t\t\t\t\t\t\t\t\t\turl: marker.url\r\n\t\t\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t\t\tif (marker.url != '') {\r\n\t\t\t\t\t\t\t\t\t\tgoogle.maps.event.addListener(mapMarker, 'click', function () {\r\n\t\t\t\t\t\t\t\t\t\t\twindow.location.href = this.url;\r\n\t\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmapMarkers.push(mapMarker);\r\n\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\t// Clusterize markers\r\n\t\t\t\t\t\t\tif (el.hasAttribute('data-clusterize-markers')) {\r\n\t\t\t\t\t\t\t\tvar clusterize = el.getAttribute('data-clusterize-markers');\r\n\t\t\t\t\t\t\t\tif (clusterize == \"true\") {\r\n\t\t\t\t\t\t\t\t\tnew MarkerClusterer(map, mapMarkers, {\r\n\t\t\t\t\t\t\t\t\t\timagePath: '/ui/images/map-icons/m',\r\n\t\t\t\t\t\t\t\t\t});\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\tif (el.hasAttribute(\"data-markersquery\")) {\r\n\t\t\t\t\t\t\tvar markersquery = el.getAttribute(\"data-markersquery\");\r\n\t\t\t\t\t\t\tif (markersquery != \"\") {\r\n\t\t\t\t\t\t\t\tvar markersinput = document.querySelector(markersquery);\r\n\t\t\t\t\t\t\t\tif (markersinput != undefined) {\r\n\t\t\t\t\t\t\t\t\tvar readMarkersData = function () {\r\n\t\t\t\t\t\t\t\t\t\tif (markersinput.value != \"\") {\r\n\t\t\t\t\t\t\t\t\t\t\tvar parts = markersinput.value.split(\"&\");\r\n\t\t\t\t\t\t\t\t\t\t\tfor (var i = 0; i < parts.length; i++) {\r\n\t\t\t\t\t\t\t\t\t\t\t\tparts[i] = decodeURIComponent(parts[i]);\r\n\t\t\t\t\t\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t\t\t\t\t\tif (parts.length > 0)\r\n\t\t\t\t\t\t\t\t\t\t\t\treloadMapMarkers(getMarkers(parts));\r\n\t\t\t\t\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\t\t\t\t\t\treloadMapMarkers([]);\r\n\t\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t\tmarkersinput.addEventListener(\"change\", readMarkersData);\r\n\r\n\t\t\t\t\t\t\t\t\tif (markers.lenght > 0)\r\n\t\t\t\t\t\t\t\t\t\treloadMapMarkers(markers);\r\n\t\t\t\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t\t\t\treadMarkersData();\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\r\n\t\t\t\t\t\t// Set Initial Zoom\r\n\t\t\t\t\t\tvar initial = true\r\n\t\t\t\t\t\tgoogle.maps.event.addListener(map, 'zoom_changed', function () {\r\n\t\t\t\t\t\t\tif (initial == true) {\r\n\t\t\t\t\t\t\t\tif (map.getZoom() > 11) {\r\n\t\t\t\t\t\t\t\t\t//map.setZoom(11);\r\n\t\t\t\t\t\t\t\t\tinitial = false;\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t});\r\n\r\n\t\t\t\t\t\t\r\n\t\t\t\t\t\tgoogle.maps.event.addListenerOnce(map, 'tilesloaded', function () {\r\n\t\t\t\t\t\t\tsetTimeout(function () {\r\n\t\t\t\t\t\t\t\tel.style.display = \"none\";\r\n\t\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t\t\tnewTarget.style.opacity = 1;\r\n\t\t\t\t\t\t\telementButton.style.opacity = 0;\r\n\t\t\t\t\t\t});\r\n\r\n\r\n\t\t\t\t\t});\r\n\t\t\t\t});\r\n\t\t\t}\r\n\t\t};\r\n\r\n\t\tvar initGoogleMapsScript = function (filename) {\r\n\t\t\tvar fileref = document.createElement('script')\r\n\t\t\tfileref.setAttribute(\"type\", \"text/javascript\")\r\n\t\t\tfileref.setAttribute(\"src\", filename)\r\n\r\n\t\t\treturn fileref\r\n\t\t}\r\n\r\n\t\tvar initGoogleMaps = function (filename) {\r\n\t\t\tvar element;\r\n\t\t\tvar allsuspects = document.getElementsByTagName(\"script\");\r\n\r\n\t\t\t// search backwards within nodelist for matching elements to remove\r\n\t\t\tfor (var i = allsuspects.length; i >= 0; i--) {\r\n\t\t\t\telement = initGoogleMapsScript(filename)\r\n\t\t\t\tif (allsuspects[i] && allsuspects[i].getAttribute(\"src\") != null && allsuspects[i].getAttribute(\"src\").indexOf(filename) != -1) {\r\n\t\t\t\t\t// Script is already loaded, reload Google Maps\r\n\t\t\t\t\tallsuspects[i].parentNode.replaceChild(element, allsuspects[i])\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Initialize Google Maps script\r\n\t\t\t\t\tdocument.getElementsByTagName('head')[0].appendChild(element);\r\n\t\t\t\t}\r\n\r\n\t\t\t\treturn element;\r\n\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif (!('Googlemaps' in element))\r\n\t\t\tinit(element);\r\n\r\n\t\telement.Googlemaps = this;\r\n\t}\r\n\r\n\tnew GoogleMaps(element);\r\n};"],"sourceRoot":""}