I updated a device property with location floating points like (11.111, -116.11) and in dms format but seems like the Azure map in dashboard doesn't get updated. Does anyone have any ideas ?
Asked
Active
Viewed 343 times
2 Answers
1
Here is an example of the location device property payload:
“devicelocation”: { “lat”: 122, “lon”: 45 }
In this example, "devicelocation" is the field name that you will have to declare when defining the device model.

Ankit Gupta - MSFT
- 111
- 3
-
I'm struggling with this issue too, and tried that snippet but can't manage to get the device properties set on iOT Central. In my case the property is named "location_data_key" and when I send the data I can only see ```[object object]```. Can you elaborate your answer, please? – Rodrigo Mar 07 '19 at 17:15
-
@Rodrigo - can you share the code here? There are [code/firmware samples](https://github.com/Azure/iot-central-firmware/blob/master/MXCHIP/mxchip_advanced/src/telemetry.cpp) that have examples on how to send location data as a reported property to IoT Central. – Ankit Gupta - MSFT Mar 08 '19 at 21:57
1
If you are using .Net API, the location can be specified as below (code example):
TwinCollection reportedProperties = new TwinCollection();
reportedProperties["devicelocation"] = new { lon= 122, lat= 45 };

onlyphantom
- 8,606
- 4
- 44
- 58

Lasa Jay
- 26
- 1