How to use the ember-leaflet/components/geojson-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 adiwg / mdEditor / lib / ember-leaflet-table / addon / components / lgeojson-layer.js View on Github external
import Ember from 'ember';
import { get, set } from '@ember/object';
import { isEmpty } from '@ember/utils';
import Layer from 'ember-leaflet/components/geojson-layer';
import uuidV4 from 'npm:uuid/v4';
/* global L */

export default Layer.extend({
  L,
  leafletEvents: ['layerremove'],
  didCreateLayer() {
    this._super(...arguments);
    let json = this.get('geoJSON');

    //define non-enumberable properties
    Object.defineProperties(json, {
      _layer: {
        writable: true,
        configurable: true,
        enumerable: false,
        value: this.get('_layer')
      },
      state: {
        writable: true,