constructor()

in src/lib/components/molecules/canvas-map/lib/renderers/TextLayerRenderer.js [9:33]


  constructor(layer) {
    /**
     * @type {import("../layers/TextLayer").TextLayer}
     */
    this.layer = layer
    this.featureRenderer = new FeatureRenderer()

    this._element = document.createElement("div")
    this._element.className = "gv-text-layer"
    const style = this._element.style
    style.position = "absolute"
    style.width = "100%"
    style.height = "100%"
    style.overflow = "hidden"

    // Pointer events are disabled even when we have listeners attached, click/hover events will fire but
    // only for child elements, not the whole text layer. This means the most foreground text layer
    // container won't block other layers from receiving click events.
    style.pointerEvents = "none"

    this._mouseInteractionsEnabled =
      this.layer.onClick || this.layer.onHover || this.layer.restyleOnHover

    this.attachClickAndHoverListeners()
  }