{"version":3,"file":"view-script.min.js","sources":["../../../../block-editor/blocks/member-map/view-script.js","../../../../block-editor/blocks/member-map/mapbox.js"],"sourcesContent":["import { memberMap } from './mapbox.js';\n\ndocument.addEventListener('DOMContentLoaded', () => {\n\tdocument.querySelectorAll('.member-map').forEach(node => {\n\t\tlet config;\n\n\t\ttry {\n\t\t\tconfig = JSON.parse( node.querySelector('script[type=\"application/json\"]').innerHTML );\n\t\t} catch ( err ) {\n\t\t\t//\n\t\t}\n\n\t\tmemberMap( node, config );\n\t});\n});\n","import mapboxgl from 'mapbox';\n\nexport function memberMap( node, config = {} ) {\n\tconfig = {\n\t\tlat: 0,\n\t\tlon: 0,\n\t\tzoom: 13,\n\t\t...config\n\t}\n\n\tconst map = new mapboxgl.Map({\n\t\tcontainer: node,\n\t\tstyle: 'mapbox://styles/mapbox/streets-v11',\n\t\tcenter: [ config.lon, config.lat ],\n\t\tzoom: config.zoom,\n\t});\n\n\tconst pin = document.createElement('div');\n\n\tpin.style.backgroundImage = 'url(/wp-content/themes/ccusa/assets/svg/map-marker.svg)';\n\tpin.style.height = '84px';\n\tpin.style.width = '61px';\n\tpin.style.margin = '-42px 0 0 30px';\n\n\tconst marker = new mapboxgl.Marker( pin );\n\tmarker.setLngLat( [ config.lon, config.lat ] );\n\tmarker.addTo(map);\n\n\tmap.addControl( new mapboxgl.NavigationControl(), 'bottom-right' );\n}\n"],"names":["document","addEventListener","querySelectorAll","forEach","node","config","JSON","parse","querySelector","innerHTML","err","lat","lon","zoom","map","mapboxgl","Map","container","style","center","pin","createElement","backgroundImage","height","width","margin","marker","Marker","setLngLat","addTo","addControl","NavigationControl","memberMap"],"mappings":"0BAEAA,SAASC,iBAAiB,oBAAoB,KAC7CD,SAASE,iBAAiB,eAAeC,SAAQC,IAChD,IAAIC,EAEJ,IACCA,EAASC,KAAKC,MAAOH,EAAKI,cAAc,mCAAmCC,UAC3E,CAAC,MAAQC,GACT,ECPI,SAAoBN,EAAMC,EAAS,IACzCA,EAAS,CACRM,IAAK,EACLC,IAAK,EACLC,KAAM,MACHR,GAGJ,MAAMS,EAAM,IAAIC,EAASC,IAAI,CAC5BC,UAAWb,EACXc,MAAO,qCACPC,OAAQ,CAAEd,EAAOO,IAAKP,EAAOM,KAC7BE,KAAMR,EAAOQ,OAGRO,EAAMpB,SAASqB,cAAc,OAEnCD,EAAIF,MAAMI,gBAAkB,0DAC5BF,EAAIF,MAAMK,OAAkB,OAC5BH,EAAIF,MAAMM,MAAkB,OAC5BJ,EAAIF,MAAMO,OAAkB,iBAE5B,MAAMC,EAAS,IAAIX,EAASY,OAAQP,GACpCM,EAAOE,UAAW,CAAEvB,EAAOO,IAAKP,EAAOM,MACvCe,EAAOG,MAAMf,GAEbA,EAAIgB,WAAY,IAAIf,EAASgB,kBAAqB,eACnD,CDjBEC,CAAW5B,EAAMC,EAAQ,GACxB"}