Working with Location Services with ArcGIS REST JS

A. Davis, Noah Mulfinger, Gavin Rehkemper, Jacob Wasilkowski

@araedavis, @noahmulfinger, @gavinr, @jwasilgeo

Slides: esriurl.com/ds21rest

Query a feature layer


					import {
					  queryFeatures
					} from "@esri/arcgis-rest-feature-layer";

					queryFeatures({
					  url: "https://services3.arcgis.com/GVgbJbqm8hXASVYi/arcgis/rest/services/LA_County_Parcels/FeatureServer/0",
					  where: "UseType = 'Residential'"
					}).then((response) => {
					  console.log(response.features);
					});
				
https://developers.arcgis.com/arcgis-rest-js/layers/query-a-feature-layer-sql/

Edit feature data


					import {
					  addFeatures,
					  updateFeatures,
					  deleteFeatures
					} from "@esri/arcgis-rest-feature-layer";

					addFeatures({
					  url: featureServiceLayerUrl,
					  features: [featureToAdd]
					}).then((response) => console.log(response));

					// similarly:
					// updateFeatures()
					// deleteFeatures()
				
https://developers.arcgis.com/arcgis-rest-js/layers/edit-feature-data/

Querying data

					
					import {
					  queryDemographicData
					} from "@esri/arcgis-rest-demographics";
				
					queryDemographicData({
					  studyAreas: [{
					    geometry: { x: 0.1278, y: 51.5074 } // Long/Lat
					  }], 
					  authentication: authentication
					}).then(response => {
					  // Demographic data for 1 mile radius around point
					  console.log(response);
					});
					
				
https://developers.arcgis.com/arcgis-rest-js/demographic-data/query-demographic-data/

Using an API Key

Demographics scope added to an API key