Displaying Location on IoT Cloud Map Widget

Hi
I am trying to display my location on an IoT Cloud Map Widget and have searched the web but it seems that the map widget, the CloudLocation variable type and the Location() functions are not well documented. I need to know exactly how to use these for my project.

Note: I already know my longitude and latitude and I am getting them using OpenWeatherMap API. This is not related to my question but I wanted to say that I have not had any trouble getting the coordinates but displaying them.

Right.

Begin by explaining what that is and give the Web links.

Don't worry. I have solved this by using what I thought would work and it did.

Hello @abdullahmc,

Can you tell us how you did it?

I'm having the same problem as you did, and I'm wondering the solution you got.

1 Like

Ok, if someone is looking how to use the Map Widget, after Arduino IoT Cloud create the CloudLocation variable in the thingProperties.h tab, as for example (I named the variable "coordinates"):

CloudLocation coordinates;

You need to chage the latitude and longitude values in the next form (inside your loop() code or whatever):

double  Lat;
double  Long;

coordinates = {Lat, Long};

The Lat and Long variables can be of double type or float if you like.

After the program runs the ArduinoCloud.update(); line, it should update the coodinates, required for the Map Widget, in the Arduino IoT Cloud.

5 Likes

Yes, I think that makes it all quite clear. :crazy_face:

1 Like

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.