How to use the ember-leaflet/macros/to-lat-lng 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 / marker-layer.js View on Github external
leafletOptions: Object.freeze([
    'icon', 'clickable', 'draggable', 'keyboard', 'title',
    'alt', 'zIndexOffset', 'opacity', 'riseOnHover', 'riseOffset'
  ]),

  leafletEvents: Object.freeze([
    'dragstart', 'drag', 'dragend', 'move', 'moveend',
    'remove', 'add', 'popupopen', 'popupclose'
  ]),

  leafletProperties: Object.freeze([
    'zIndexOffset', 'opacity', 'location:setLatLng'
  ]),

  location: toLatLng(),

  createLayer() {
    return this.L.marker(...this.get('requiredOptions'), this.get('options'));
  },

  // icon observer separated from generated (leaflet properties) due to a
  // leaflet bug where draggability is lost on icon change
  // eslint-disable-next-line ember/no-observers
  iconDidChange: observer('icon', function() {
    this._layer.setIcon(this.get('icon'));

    if (this.get('draggable')) {
      this._layer.dragging.enable();
    } else {
      this._layer.dragging.disable();
    }
github miguelcobain / ember-leaflet / addon / components / leaflet-map.js View on Github external
'click', 'dblclick', 'mousedown', 'mouseup', 'mouseover', 'mouseout',
    'mousemove', 'contextmenu', 'focus', 'blur', 'preclick', 'load',
    'unload', 'viewreset', 'movestart', 'move', 'moveend', 'dragstart',
    'drag', 'dragend', 'zoomstart', 'zoomend', 'zoomlevelschange',
    'resize', 'autopanstart', 'layeradd', 'layerremove',
    'baselayerchange', 'overlayadd', 'overlayremove', 'locationfound',
    'locationerror', 'popupopen', 'popupclose'
  ]),

  leafletProperties: Object.freeze([
    'zoom:setZoom:zoomPanOptions', 'minZoom', 'maxZoom',
    'center:panTo:zoomPanOptions',
    'bounds:fitBounds:fitBoundsOptions', 'maxBounds'
  ]),

  center: toLatLng(),

  // By default all layers try to register in a container layer.
  // It is not the case of the map itself as it is the topmost container.
  registerWithParent() { },
  unregisterWithParent() { },

  createLayer() {
    let options = this.get('options');

    // Don't set center and zoom right now.
    // Let base layer bind the events first
    delete options.center;
    delete options.zoom;
    return this.L.map(this.element, options);
  },
github miguelcobain / ember-leaflet / addon / components / point-path-layer.js View on Github external
import PathLayer from 'ember-leaflet/components/path-layer';
import toLatLng from 'ember-leaflet/macros/to-lat-lng';

export default PathLayer.extend({

  leafletRequiredOptions: Object.freeze([
    'location'
  ]),

  leafletProperties: Object.freeze([
    'location:setLatLng'
  ]),

  location: toLatLng()
});