addSymbol()
The function allows to add a custom symbol to the Maps Widget.
Synopsis
void addSymbol(string name, float lat, float lon[, mapping options[,int layerId = 1]])
void addSymbol(string name, string coordinate[, mapping options[,int layerId = 1]])
Parameter
Parameter | Description |
---|---|
name | Name of object |
lat | Latitude |
lon | Longitude |
options | Additional settings |
coordinate | Longitude and Latitude as string, see coordinate conversion. |
layerId | Layer number, default:1 |
Description
The function allows to add a custom object (panel reference) directly to the Maps Widget. The symbol is displayed at the stated coordinates (either as float value pair lat/lon or as string coordinate).
The mapping keys "minDistance" and "maxDistance" are used to define for which viewing distance the object will be displayed. If the current viewing distance is outside of the specified range the object is hidden. The default value for both is 0.
The layer where the symbol should be added can be defined additionally.
Example
Maps_ewo1.addSymbol("plane", 48.123, 16.456, makeMapping("maxDistance", 6000, "minDistance", 300));
It must be considered that the object to be displayed must first be added to the panel using the regular Control function addSymbol() before adding it to the Maps Widget using this function.
Example
addSymbol(self, "plane.pnl", "plane", makeDynString(), 0, 0, 0, 1, 1, "Maps_ewo1");
Maps_ewo1.addSymbol(“plane”, 48.123, 16.456, makeMapping("maxDistance", 6000, "minDistance", 300));
If the object with a given name is added twice it is just moved from one position to the new position. This can be used for e.g. animating movements on the map.
main()
{
addSymbol( myModuleName(), myPanelName(), "mapobj.pnl", "test", makeDynString(), 0, 0, 0, 1, 1, "EWO_MAP" );
string fullName = myModuleName() + "." + myPanelName() + ":test";
EWO_MAP.addSymbol( fullName, 48, 16 );
}
Assignment
See also
-