Geofences in Analysis

Geofences in Analysis

@Andreas Gudmundsson

Hi all, I am trying to create some dynamic geofences in my blueprint dashboard; essentially a circle which is always over the device’s most recent location. I’ve been reading the documentation both on here and in the geolib Node library but can’t seem to figure out what caused this issue. Here is the object I created:

const new_geofence = {
“id”: “1”,
“variable”: “geofence”,
“time”: “2021-01-31T20:51:59.134Z”,
“origin”: “1”,
“value”: “”,
“serie”: “0”,
“metadata”: {
“id”: “1”,
“color”: “”,
“geolocation”: {
“type”: “Point”,
“coordinates”: [lat, long],
“radius”: radius
},
“event”: “Location with radius”
}
}

Reading the value of this geofence after sending it confirms that it filled in the id, origin and metadata.id for me. After running device.sendData, I now get this message in place of the map:

Oops!

TypeError: Cannot read property ‘x’ of undefined

Nothing I do seems to make the map data come back. Any ideas on what went wrong and hopefully how to fix it?