Sanjeev Shrestha
Sanjeev Shrestha

Reputation: 23

What is the correct format for location that works with azure iot central's device property?

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 ?

Upvotes: 2

Views: 345

Answers (2)

Lasa Jay
Lasa Jay

Reputation: 26

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 };

Upvotes: 1

Ankit Gupta - MSFT
Ankit Gupta - MSFT

Reputation: 126

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.

Upvotes: 1

Related Questions