This page describes the methods in the Map
for sending data and commands to the map visualizer. The map visualizer shows geographic markers on a MapQuest map.
Methods
Create a Map
variable and uses these methods to send data to a map visualizer.
Method Descriptions
Map Constructor
Creates a Map
variable, which can be used to send commands and data to a MegunoLink map visualizer.
Map()
Map(Print& Destination = Serial)
Map(const char* Channel, Print& Destination = Serial)
Map(const __FlashStringHelper* Channel, Print& Destination = Serial)
Name | Type | Required? | Description |
---|---|---|---|
Channel | const char *, const __FlashStringHelper | No | The name of the destination channel for report table messages. Defaults to the broadcast channel (NULL ). |
Destination | Print & | No | Sets the serial connection to use for sending messages to MegunoLink. Defaults to Serial , the default Arduino RS232 port. |
1 2 3 4 5 |
#include "MegunoLink.h" Map MyMap1; // send messages via the default serial port and channel. Map MyMap2("Base"); // use the 'Base' message channel for sending data Map MyMap3(F("Base"), Serial1); // send messages via the Serial1 port with 'Base' message channel. |
Send Data
Send a map location to MegunoLink. The location is marked on the map and shown in the list of locations.
SendData(const char* Placename, const char* Latitude, const char* Longitude)
SendData(const __FlashStringHelper* Placename, const char* Latitude, const char* Longitude)
SendData(const char* Placename, float Latitude, float Longitude)
SendData(const __FlashStringHelper* Placename, float Latitude, float Longitude)
Name | Type | Required? | Description |
---|---|---|---|
Placename | const char *, const __FlashStringHelper | Yes | The name of the location. |
Latitude | const char*, float | Yes | The latitude of the location. |
Longitude | const char*, float | Yes | The longitude of the location. |
1 2 3 |
Map1.SendData("Home", "-37.785949", "175.30081"); Map1.SendData(F("Work"), -37.885989, 175.50061); Map1.SendData("Middle Earth", -37.835989, 175.70061); |