How to use the esri-leaflet.Service.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 / Services / Geocode.js View on Github external
import { Service } from 'esri-leaflet';
import { WorldGeocodingServiceUrl } from '../helper';
import geocode from '../Tasks/Geocode';
import reverseGeocode from '../Tasks/ReverseGeocode';
import suggest from '../Tasks/Suggest';

export var GeocodeService = Service.extend({
  initialize: function (options) {
    options = options || {};
    if (options.url) {
      Service.prototype.initialize.call(this, options);
      this._confirmSuggestSupport();
    } else {
      options.url = WorldGeocodingServiceUrl;
      options.supportsSuggest = true;
      Service.prototype.initialize.call(this, options);
    }
  },

  geocode: function () {
    return geocode(this);
  },