Skip to content

esri client.js

andy.rothwell edited this page Sep 27, 2018 · 4 revisions

esri-client.js

Functions

fetch

The fetch() function is called if a datasource uses "type: 'esri'". For example:

export default {
  id: 'divisions',
  url: 'https://services.arcgis.com/fLeGjb7u4uXqeF9q/arcgis/rest/services/Political_Divisions/FeatureServer/0',
  type: 'esri',
  options: {
    relationship: 'contains',
  },
  success(data) {
    return data;
  },
};

The function takes the following parameters:

parameter description or example
feature
dataSource
dataSourceKey

fetchNearby

The fetchNearby() function is called if a datasource uses "type: 'esri-nearby'". For example:

export default {
  id: 'neighboringProperties',
  type: 'esri-nearby',
  url: 'https://services.arcgis.com/fLeGjb7u4uXqeF9q/ArcGIS/rest/services/PWD_PARCELS/FeatureServer/0',
  options: {
    geometryServerUrl: '//gis.phila.gov/arcgis/rest/services/Geometry/GeometryServer/',
    calculateDistance: true,
    distances: 320,
  }
}

The function takes the following parameters:

parameter description or example
feature
dataSource
dataSourceKey

fetchBySpatialQuery

fetchBySpatialQuery is called by both "fetch" and "fetchNearby". The function takes the following parameters:

parameter description or example
dataSourceKey
url
relationship
targetGeom
parameters
options
calculateDistancePt
Clone this wiki locally