Sha256: 3851e8e798b6d4e001b1bde34aa9e4b0e87309d878f4e6433b3fc7c763521012
Contents?: true
Size: 1.18 KB
Versions: 22
Compression:
Stored size: 1.18 KB
Contents
import MapController from "src/decidim/map/controller" const openLink = window.open; export default class MapStaticController extends MapController { start() { this.map.removeControl(this.map.zoomControl); this.map.dragging.disable(); this.map.touchZoom.disable(); this.map.doubleClickZoom.disable(); this.map.scrollWheelZoom.disable(); this.map.boxZoom.disable(); this.map.keyboard.disable(); if (this.map.tap) { this.map.tap.disable(); } if (this.config.zoom) { this.map.setZoom(this.config.zoom); } else { this.map.setZoom(15); } if (this.config.latitude && this.config.longitude) { const coordinates = [this.config.latitude, this.config.longitude]; this.map.panTo(coordinates); const marker = L.marker(coordinates, { icon: this.createIcon(), keyboard: true, title: this.config.title }).addTo(this.map); marker._icon.removeAttribute("tabindex"); } if (this.config.link) { this.map._container.addEventListener("click", (ev) => { ev.preventDefault(); this.map._container.focus(); openLink(this.config.link, "_blank"); }); } } }
Version data entries
22 entries across 22 versions & 1 rubygems