CityOfBoston / vision-zero

2 stars 1 forks source link

Remove esri-leaflet dependency #25

Open paylakatel opened 6 years ago

paylakatel commented 6 years ago

Right now we use esri-leaflet to query our data layers when we need information like counts of points or the last time the data was updated.

We should remove that dependency and just use AJAX for fetch or some other thing like that to query the geojson layer.

jgravois commented 5 years ago

👋

@esri/arcgis-rest-feature-service is open source, only ~1kb and wraps fetch with some (helpful) sugar.

https://esri.github.io/arcgis-rest-js/guides/package-overview/ https://esri.github.io/arcgis-rest-js/api/feature-service/queryFeatures/

paylakatel commented 5 years ago

This is great - thanks for this! Will take a look at it when working on this issue. Thanks for pointing it out!

jgravois commented 5 years ago

my pleasure! if you have any questions whenever you sit down and take a look, don't be shy. its a new library and we're looking for user feedback.


queryFeatures({
  url,
  // where: "1=1", (this is the default)
  // outFields: "*", (this is the default)
  outSR: 4326,
  params: { f: 'geojson' }
})
  .then(feature => {
    // GeoJSON FeatureCollection
  });
paylakatel commented 5 years ago

Awesome - will be sure to let you know how it goes. Thanks again!