{"version":3,"file":"js/custom/modals/select-location.js","mappings":";;;;;;AAAa;AACb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,8BAA8B,EAAE,yBAAyB,EAAE,EAAE,EAAE,EAAE,EAAE;AACnE,iCAAiC;AACjC,SAAS;AACT;AACA;AACA;AACA;AACA;AACA,UAAU;AACV;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,mBAAmB,4DAA4D,oBAAoB;AAC7I;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iBAAiB;AACjB;AACA,iBAAiB;AACjB,aAAa;AACb,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA,kBAAkB;AAClB;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAa;AACb;AACA;AACA,CAAC;AACD;AACA;AACA;AACA;AACA,CAAC","sources":["webpack://metronic/../demo1/src/js/custom/modals/select-location.js"],"sourcesContent":["\"use strict\";\r\n\r\n// Class definition\r\nvar KTModalSelectLocation = function () {\r\n // Private variables\r\n var locationSelectTarget;\r\n var locationSelectButton;\r\n\r\n var modal;\r\n var selectedlocation = '';\r\n var mapInitialized = false;\r\n\r\n // Private functions\r\n var initMap = function() {\r\n // Check if Leaflet is included\r\n if (!L) {\r\n return;\r\n }\r\n\r\n // Define Map Location\r\n var leaflet = L.map('kt_modal_select_location_map', {\r\n center: [40.725, -73.985],\r\n zoom: 30\r\n });\r\n\r\n // Init Leaflet Map. For more info check the plugin's documentation: https://leafletjs.com/\r\n L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {\r\n attribution: '© OpenStreetMap contributors'\r\n }).addTo(leaflet);\r\n\r\n // Set Geocoding\r\n var geocodeService;\r\n if (typeof L.esri.Geocoding === 'undefined') {\r\n geocodeService = L.esri.geocodeService();\r\n } else {\r\n geocodeService = L.esri.Geocoding.geocodeService();\r\n }\r\n\r\n // Define Marker Layer\r\n var markerLayer = L.layerGroup().addTo(leaflet);\r\n\r\n // Set Custom SVG icon marker\r\n var leafletIcon = L.divIcon({\r\n html: ``,\r\n bgPos: [10, 10],\r\n iconAnchor: [20, 37],\r\n popupAnchor: [0, -37],\r\n className: 'leaflet-marker'\r\n });\r\n\r\n // Map onClick Action\r\n leaflet.on('click', function (e) {\r\n geocodeService.reverse().latlng(e.latlng).run(function (error, result) {\r\n if (error) {\r\n return;\r\n }\r\n markerLayer.clearLayers();\r\n selectedlocation = result.address.Match_addr;\r\n L.marker(result.latlng, { icon: leafletIcon }).addTo(markerLayer).bindPopup(result.address.Match_addr, { closeButton: false }).openPopup();\r\n\r\n // Show popup confirmation. For more info check the plugin's official documentation: https://sweetalert2.github.io/\r\n Swal.fire({\r\n html: '