Locations File
The locations that are rendered on the map are not dynamically constructed. Instead a GeoJSON-ish file is used. The file is publicly stored in a Google Storage Bucket and access when the app is opened.
Warning: The format of this file is likely to change
https://storage.googleapis.com/waterdatainitiative/locations.json
{
"type": "FeatureCollection",
"features": [
{
"type": "feature",
"geometry": {
"coordinates": [
-108.13589,
36.76818
],
"type": "Point"
},
"properties": [
{
"@iot.id": 15,
"@iot.selfLink": "http://104.196.225.45/v1.0/Things(15)",
"name": "WaterLevelPressure",
"description": "Water Well",
"properties": {
"@nmbgmr.point_id": "AR-0051"
},
"Locations@iot.navigationLink": "http://104.196.225.45/v1.0/Things(15)/Locations",
"Datastreams@iot.navigationLink": "http://104.196.225.45/v1.0/Things(15)/Datastreams",
"HistoricalLocations@iot.navigationLink": "http://104.196.225.45/v1.0/Things(15)/HistoricalLocations"
}
],
"link": "http://104.196.225.45/v1.0/Locations(15)"
}]
}
The DemoApp uses the geometry.coordinates
field for plotting the data point. The link
is also attached to the datapoint. When a point is clicked on the map the link
is used to populate the Locations table.