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

Version Path
decidim-core-0.29.1 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.4 app/packs/src/decidim/map/controller/static.js
decidim-core-0.27.9 app/packs/src/decidim/map/controller/static.js
decidim-core-0.29.0 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.3 app/packs/src/decidim/map/controller/static.js
decidim-core-0.27.8 app/packs/src/decidim/map/controller/static.js
decidim-core-0.29.0.rc4 app/packs/src/decidim/map/controller/static.js
decidim-core-0.29.0.rc3 app/packs/src/decidim/map/controller/static.js
decidim-core-0.29.0.rc2 app/packs/src/decidim/map/controller/static.js
decidim-core-0.29.0.rc1 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.2 app/packs/src/decidim/map/controller/static.js
decidim-core-0.27.7 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.1 app/packs/src/decidim/map/controller/static.js
decidim-core-0.27.6 app/packs/src/decidim/map/controller/static.js
decidim-core-0.26.10 app/packs/src/decidim/map/controller/static.js
decidim-core-0.26.9 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.0 app/packs/src/decidim/map/controller/static.js
decidim-core-0.27.5 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.0.rc5 app/packs/src/decidim/map/controller/static.js
decidim-core-0.28.0.rc4 app/packs/src/decidim/map/controller/static.js