Published
Edited
Feb 28, 2022
1 fork
Importers
Insert cell
Insert cell
data = []
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
q = "full_addre like '%LaSalle%'"
Insert cell
m = new MapData()
Insert cell
class MapData {
constructor(params) {
}
data_ = []
queryData(q) {
console.log(this.data_)

}
}
Insert cell
colors_ins
Insert cell
viewof colors_ins = Inputs.form(
color_values_mappedout.map((v) => {
return Inputs.color({ label: v });
})
)

Insert cell
function executeQuery(whereClause, outFields, geometry) {
arcgisRest
.queryFeatures({
url:
"https://services3.arcgis.com/ooi7zGuIHJJMBlWB/arcgis/rest/services/looplight/FeatureServer/0",
geometry: geometry,
geometryType: "esriGeometryEnvelope",
inSR: 4326, // EPSG:4326 uses latitudes and longitudes
spatialRel: "esriSpatialRelIntersects",
where: whereClause,
f: "geojson",
returnGeometry: true,
// returnIdsOnly:false,
outFields: [...outFields]
})

.then((response) => {
console.log(response);
if (data.length > 0) {
while (data.length > 0) {
data.pop();
}
}
data.push(response);
});
}
Insert cell
arcgisRest = await require("https://unpkg.com/@esri/arcgis-rest-feature-layer@3.4.3/dist/umd/feature-layer.umd.min.js")
Insert cell
Type JavaScript, then Shift-Enter. Ctrl-space for more options. Arrow ↑/↓ to switch modes.

Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more