The map visualizer displays GPS locations on a map downloaded automatically from MapQuest.

Locations can be obtained by your Arduino sketch using a GPS sensor. Most GPS sensors send serial data in NEMA format, which can be readily decoded by the tiny GPS Arduino library.

The built-in MapQuest API key lets you quickly try out the mapping visualizer before requesting your own (free) MapQuest API key for more frequency map updates.

Map visualizer

Display locations from a GPS sensor using the map visualizer.

Creating a Map Visualizer

Select Mapping from the visualizer menu or toolbox to add a new map visualizer to your MegunoLink project. You can add as many map visualizers as you like. Use message channels in your Arduino sketch to control the data sent to each visualizer.

Drag the visualizer tab to organize the windows in your MegunoLink project.

Map controls can also be added to interface panels.

Sending Data from an Arduino

Create a Map variable to send data from your Arduino sketch to a map visualizer. After installing the Arduino library:

  1. Add #include "MegunoLink.h" to the top of your Arduino sketch,
  2. Create a variable to send data: Map MyMap, then
  3. Call MyMap.SendData(/*Label*/, /*Latitude*/, /*Longitude*/) to send a location to MegunoLink.

The Arduino map library reference has details of all the methods available.

This example uses the fantastic TinyGPSPlus library to decode GPS messages and send location to MegunoLink periodically. Most GPS devices send data using the NMEA standard so the TinyGPSPlus library works with the majority of GPS sensors. We used a Titan X1 GPS receiver, which sends its data through a serial connection. The SoftwareSerial library was used to receive data from the GPS sensor on an Arduino board. The data is fed into the Tiny GPS Plus library as it arrives, which decodes the position information. The position is sent to MegunoLink every 30 seconds (highlighted).

User Interface

The mapping visualizer user interface shows the locations sent from your Arduino sketch on a map and in a list. Uncheck items in the list to hide them from the map. A map view encompassing all of the selected locations is displayed automatically.

Mapping visualizer user interface

The mapping visualizer user interface.

Visualizer Toolbar

Tool Description
Connect/disconnect button Connect/disconnect the selected connection. Use the drop-down to select the connection used by this visualizer.
Channel selector Select the channels processed by the visualizer (message logger only).
Edit API key Change the MapQuest API key (see below).
Clear map locations Remove all locations.
Refresh map Reload the map.
Help Open online documentation for the visualizer.

More Information

Start typing and press Enter to search