How to use the ember-leaflet/components/div-overlay-layer.extend function in ember-leaflet

To help you get started, we’ve selected a few ember-leaflet examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github miguelcobain / ember-leaflet / addon / components / tooltip-layer.js View on Github external
import { reads } from '@ember/object/computed';
import { next } from '@ember/runloop';
import DivOverlayLayer from 'ember-leaflet/components/div-overlay-layer';

export default DivOverlayLayer.extend({

  leafletOptions: Object.freeze([
    'direction', 'permanent', 'sticky', 'interactive', 'opacity'
  ]),

  // if this tooltip is permanent, we need to render the content immediately
  shouldRender: reads('permanent'),

  createLayer() {
    return this.L.tooltip(this.get('options')).setContent(this.get('destinationElement'));
  },

  didCreateLayer() {
    this._addPopupListeners();
  },
github miguelcobain / ember-leaflet / addon / components / popup-layer.js View on Github external
import { observer } from '@ember/object';
import { later, cancel, next } from '@ember/runloop';
import DivOverlayLayer from 'ember-leaflet/components/div-overlay-layer';

export default DivOverlayLayer.extend({

  leafletOptions: Object.freeze([
    'maxWidth', 'minWidth', 'maxHeight', 'autoPan', 'autoPanPaddingTopLeft',
    'autoPanPaddingBottomRight', 'autoPanPadding', 'keepInView', 'closeButton',
    'autoClose'
  ]),

  isOpen() {
    // leaflet 1 added an `isOpen` method
    return this._layer.isOpen ? this._layer.isOpen() : this._layer._isOpen;
  },

  /*
   * Action to yield to block
   */
  closePopup() {