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app/javascript/packs/map.ts"],"sourcesContent":["import * as leaflet from \"leaflet\";\nimport \"leaflet/dist/leaflet.css\";\nimport \"../map.scss\";\nimport marker1x from \"leaflet/dist/images/marker-icon.png\";\nimport marker2x from \"leaflet/dist/images/marker-icon-2x.png\";\nimport markerSh from \"leaflet/dist/images/marker-shadow.png\";\n\ninterface Point {\n name: string;\n latitude: number;\n longitude: number;\n}\n\nconst DENVER_DOWNTOWN: leaflet.LatLngTuple = [\n 39.75316148610883,\n -105.00014407137768\n];\n\nfunction tileSet(): leaflet.TileLayer {\n return leaflet.tileLayer(\n \"https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png\",\n {\n tileSize: 256,\n // detectRetina: true,\n attribution:\n '© OpenStreetMap contributors'\n }\n );\n}\n\n// HACK: URL is corrupted on the way into Rails; we fix the URLs and leave the other options at default\n// https://github.com/Leaflet/Leaflet/blob/0f904a515879fcd08f69b7f51799ee7f18f23fd8/src/layer/marker/Icon.Default.js#L23-L30\nconst pin = new leaflet.Icon({\n iconUrl: marker1x,\n iconRetinaUrl: marker2x,\n shadowUrl: markerSh,\n iconSize: [25, 41],\n iconAnchor: [12, 41],\n popupAnchor: [1, -34],\n tooltipAnchor: [16, -28],\n shadowSize: [41, 41]\n});\n\nconst tgts: HTMLElement[] = Array.prototype.slice.call(\n document.querySelectorAll(\".map-embed\")\n);\n\ntgts.forEach(tgt => {\n const latitude = parseFloat(tgt.getAttribute(\"data-latitude\"));\n const longitude = parseFloat(tgt.getAttribute(\"data-longitude\"));\n const map = leaflet.map(tgt, { center: [latitude, longitude], zoom: 13 });\n tileSet().addTo(map);\n leaflet.marker([latitude, longitude], { icon: pin }).addTo(map);\n});\n\nconst birdseyes: HTMLElement[] = Array.prototype.slice.call(\n document.querySelectorAll(\".map-embed-birdseye\")\n);\n\nbirdseyes.forEach(tgt => {\n const map = leaflet.map(tgt, { center: DENVER_DOWNTOWN, zoom: 10 });\n tileSet().addTo(map);\n const locs = JSON.parse(tgt.getAttribute(\"data-locs\"));\n const markers: leaflet.Marker[] = locs.map((point: Point) => {\n const coords: leaflet.LatLngTuple = [point.latitude, point.longitude];\n const marker = leaflet.marker(coords, { icon: pin });\n marker.bindPopup(point.name);\n return marker;\n });\n markers.forEach(m => m.addTo(map));\n map.fitBounds(leaflet.featureGroup(markers).getBounds());\n window.birdseyeMap = map;\n});\n"],"names":["DENVER_DOWNTOWN","tileSet","leaflet","tileSize","attribution","pin","iconUrl","marker1x","iconRetinaUrl","marker2x","shadowUrl","markerSh","iconSize","iconAnchor","popupAnchor","tooltipAnchor","shadowSize","Array","prototype","slice","call","document","querySelectorAll","forEach","tgt","latitude","parseFloat","getAttribute","longitude","map","center","zoom","addTo","icon","markers","JSON","parse","point","coords","marker","bindPopup","name","m","fitBounds","getBounds","window","birdseyeMap"],"sourceRoot":""}