You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The **advanced map widget** is used to track the location of a cloud Thing and draw a path between the different logged points. You can track the data in both real time, select from a specific time period while selecting the variables you want to display.
This widget can be added onto existing projects (if you are already tracking location), and is particularly interesting to use in projects such as:
13
13
- Weather stations,
14
14
- Environmental data stations,
15
+
- Monitoring fleets,
16
+
- Any project requiring localization of devices,
15
17
- Various science projects where location tracking is needed.
16
18
17
-
This widget can use variables from **different Things**, so you can monitor data from various devices and plot it all in one place.
18
-
19
-
For example, you could set up a series of sensors around a city, and measure the CO2 emissions from your phone or laptop in a single chart!
20
-
21
19
## Hardware & Software Needed
22
20
23
21
-[Arduino Cloud](https://app.arduino.cc/).
24
22
- Cloud compatible boards, [see full list](https://docs.arduino.cc/arduino-cloud/guides/overview#compatible-hardware).
25
23
24
+
***In this tutorial, we use the [MKR WiFi 1010](/hardware/mkr-wifi-1010) and [MKR GPS Shield](/hardware/mkr-gps-shield) for tracking latitude and longitude. This is not a requirement, you can use any board for this tutorial.***
25
+
26
26
## Setup & Configuration
27
27
28
-
To use the advanced map widget, you will need to set up a Thing and a variable that you want to track. This variable needs to be a `location` type.
28
+
To use the advanced map widget, you will need to set up a Thing and a variable that you want to track. This needs to be a `location` type variable.
29
29
30
30
***If you are unfamiliar with how to set up a Thing and variables, head on over to the [Getting Started with the Arduino Cloud](/arduino-cloud/guides/overview) article.***
31
31
@@ -39,46 +39,76 @@ To use the advanced map widget, you will need to set up a Thing and a variable t
39
39
40
40
**4.** After selection, your variables will appear in the right panel, with a number of configuration options. You can for example choose how the track between logged locations will be represented (line, spline, spline area, line area and bar). You can also change the icon of the pin on the map.
**5.** Click on **"Done"** when finished selecting the variable. If your board is connected and is sending data to the Cloud, you will see the widget's location data update frequently.
45
45
46
46
## Example Code
47
47
48
-
The sketch of your project does not require much complexity. In your automatically generated code, simply add the location tracking code inside of the loop. :
48
+
The sketch of your project does not require much complexity. In your automatically generated code, simply add the location tracking code inside of the loop. We are using the [Arduino_MKRGPS](https://www.arduino.cc/reference/en/libraries/arduino_mkrgps/) library. We only needed to add these following lines to the loop to track the things location and send it to the advanced map widget:
With the widget set up, let's explore some of its features.
57
91
58
-
### Value Tracking
92
+
### Location Tracking
93
+
94
+
When tracking the location with the "Live" setting the current location of the device will be marked with a pin, then a track will be drawn between its previous location and its current location.
59
95
60
-
Hover over a line to see what the value of a variable was in a specific point in time. In this case, we choose to check only the temperature and the humidity.
96
+

61
97
62
-

98
+
Picking one of the other time frame options will show the locations of the device during that specific time frame.
63
99
64
100
### Specific Time Period
65
101
66
102
To see a specific time period, click on the calendar icon, where you can select the starting & end time & date.
67
103
68
104

69
105
70
-
As an example, the widget below shows the illuminance (LUX) recorded via the **MKR ENV Shield**, the `light` variable.
71
-
72
-
Here, we can see that sunset occurred around 18.00 (6PM), and sunrise sometime around 07.00 (7AM).
73
-
74
-

75
-
76
106
## Limitations
77
107
78
-
The following variables are not supported in the advanced chart widget.
108
+
The following variables are not supported in the advanced map widget.
79
109
80
110
-
81
111
82
112
## Summary
83
113
84
-
The advanced chart widget can be used for **any** project that includes location tracking. It is perfect for scientific projects when monitoring the location of the cloud Thing over time is needed.
114
+
The advanced map widget can be used for **any** project that includes location tracking. It is perfect for scientific projects when monitoring the location of the cloud Thing over time is needed.
0 commit comments