{"version":3,"file":"Src_Scripts_components_google-maps-content-page_js.b0bc3bcd04cb8ea748e9.js","sources":["webpack://haveselskabet/./Src/Scripts/components/google-maps-content-page.js","webpack://haveselskabet/./node_modules/load-google-maps-api/index.js"],"sourcesContent":["const loadGoogleMapsApi = require('load-google-maps-api');\n\nexport default class GoogleMapsContentPage {\n constructor(elm, args) {\n loadGoogleMapsApi({\n key: 'AIzaSyDuSRIutlsRen3wTJzjEKfR_tVSj7FAMJw'\n }).then(function (googleMaps) {\n let map = new googleMaps.Map(elm, {\n center: {\n lat: parseFloat(args.lat),\n lng: parseFloat(args.lng)\n },\n zoom: 15,\n });\n new google.maps.Marker({\n position: new google.maps.LatLng(args.lat, args.lng),\n map: map,\n icon: new google.maps.MarkerImage('/static/mapmarkers/marker-2.svg', null, null, null, new google.maps.Size(45, 54))\n });\n });\n }\n}\n","const API_URL = 'https://maps.googleapis.com/maps/api/js'\nconst CALLBACK_NAME = '__googleMapsApiOnLoadCallback'\n\nconst optionsKeys = ['channel', 'client', 'key', 'language', 'region', 'v']\n\nlet promise = null\n\nmodule.exports = function (options = {}) {\n promise =\n promise ||\n new Promise(function (resolve, reject) {\n // Reject the promise after a timeout\n const timeoutId = setTimeout(function () {\n window[CALLBACK_NAME] = function () {} // Set the on load callback to a no-op\n reject(new Error('Could not load the Google Maps API'))\n }, options.timeout || 10000)\n\n // Hook up the on load callback\n window[CALLBACK_NAME] = function () {\n if (timeoutId !== null) {\n clearTimeout(timeoutId)\n }\n resolve(window.google.maps)\n delete window[CALLBACK_NAME]\n }\n\n // Prepare the `script` tag to be inserted into the page\n const scriptElement = document.createElement('script')\n const params = [`callback=${CALLBACK_NAME}`]\n optionsKeys.forEach(function (key) {\n if (options[key]) {\n params.push(`${key}=${options[key]}`)\n }\n })\n if (options.libraries && options.libraries.length) {\n params.push(`libraries=${options.libraries.join(',')}`)\n }\n scriptElement.src = `${options.apiUrl || API_URL}?${params.join('&')}`\n\n // Insert the `script` tag\n document.body.appendChild(scriptElement)\n })\n return promise\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;;A;;;;;;;;;;;ACrBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;A;;A","sourceRoot":""}