How to use the esri-leaflet.FeatureLayerService.extend function in esri-leaflet

To help you get started, we’ve selected a few esri-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 Esri / esri-leaflet-geocoder / src / Providers / FeatureLayer.js View on Github external
import { Util, geoJson, latLngBounds as LlatLngBounds } from 'leaflet';
import { FeatureLayerService } from 'esri-leaflet';

export var FeatureLayerProvider = FeatureLayerService.extend({
  options: {
    label: 'Feature Layer',
    maxResults: 5,
    bufferRadius: 1000,
    formatSuggestion: function (feature) {
      return feature.properties[this.options.searchFields[0]];
    }
  },

  initialize: function (options) {
    FeatureLayerService.prototype.initialize.call(this, options);
    if (typeof this.options.searchFields === 'string') {
      this.options.searchFields = [this.options.searchFields];
    }
    this._suggestionsQuery = this.query();
    this._resultsQuery = this.query();