Maps Widget - Properties and Functions

This page describes the Widget specific properties and a list of available functions.

Properties

Following properties are available for the Maps Widget and can be get/set within the GEDI as well as in Control.

animationsEnabled (bool)

Specifies how a new visible section of the map is displayed:

  • false = the new section is displayed immediately
  • true = an animation is shown that moves from the current to the new section gradually.

distance (float)

Distance of the view point from the globe in meters. The higher the distance the more overview is given over the map. Less distance can be used to see additional map details.

projection (string)

The type of projection that is used to display the 3D globe onto the 2D screen. Following types of projections are available:

  • Spherical (default)
  • Equirectangular
  • Mercator
  • Gnomonic
  • Stereographic
  • LambertAzimuthal
  • AzimuthalEquidistant
  • VerticalPerspective

latitude (float)

Specifies the latitude of the center of the visible map section in degrees (positive: north of equator, negative: south of equator)

longitude (float)

Specifies the longitude of the center of the visible map section in degrees (positive: east of Greenwich, negative: west of Greenwich)

persistentTileCacheLimit (uint)

Maximum size of the persistent tile cache (tiles stored on disk) in kilobytes. Refer also to the Notes and Restrictions of the Widget.

The persistent tile cache is located under:

Windows: C:\Users\<user>\AppData\Local\.marble\data\maps\earth\openstreetmap

Linux: /home/<user>/.local/share/marble/maps/openstreetmap

renderPlugins (&dyn_string)

Returns a list of plug-in names that are available in the Maps Widget.

showCrosshairs (bool)

Specifies whether a crosshairs symbol should be displayed for the current position.

Figure 1. Crosshairs

showGrid (bool)

Specifies whether a coordinate grid is shown within the map. The grid is automatically adjusted to the zoom level of the map and latitude and longitude values are displayed for the grid lines.

Figure 2. Grid Lines

showNavigation (bool)

Specifies whether the interactive navigation box is displayed in the lower right corner of the Maps Widget or not.

showOverviewmap (bool)

Specifies whether an overview map as well as the current position on the map are displayed.

Figure 3. Overview maps

showScalebar (bool)

Specifies whether a scale bar for the map is displayed.

Figure 4. scale bar

mapThemeId (string)

Allows you to select one of the predefined map themes to be shown. Following themes are provided with the Maps Widget and located within the "data/marble/maps/" directory of the version:

  • Earth at Night (earth/citylights/citylights.dgml)
  • Empty Map (used as a base for offline maps) (earth/empty/empty.dgml)
  • OpenStreetMap (earth/openstreetmap/openstreetmap.dgml)
  • OpenTopoMap (earth/opentopomap/opentopomap.dgml)
  • Plain Map (cities, borders, rivers etc.) (earth/plain/plain.dgml)
  • Satellite View (earth/bluemarble/bluemarble.dgml)
  • WMS Example (earth/wmsexample/wmsexample.dgml)

Additional themes can be manually added to the Maps Widget, see Configuration - Map Themes.

The themes must be selected by stating the relative path to either the project directory "data/maps/maps/" or the version directory "data/marble/maps/" to the .dgml file of the map theme.

Note:

Note that additional folders within the version, e.g. "clouds" or "humanitarian" cannot be used as a map theme but are referenced by other map themes.

For downloading the map material it is also necessary to set the property workOffline (see below) to false.

volatileTileCacheLimit (uint)

Maximum size of the volatile tile cache (tiles stored in memory) in kilobytes. Please also refer to the Notes and Restrictions of the Widget.

workOffline (bool)

Specifies whether the Maps Widget will try to access online data (false) or only displays data available locally (true; default). When working in offline mode, the following data is available for the Maps Widget:

  • Map data stored in <product>/data/marble. This includes the complete physical and plain map themes, and the most zoomed-out level of the other map themes.
  • Map data stored in the tile cache. The tile cache is filled in online mode whenever new map data is downloaded up to a given limit its content is then also available offline
  • Map data added with addGeoDataFile().

zoomStep (int)

Specifies the factor which is zoomed per step when using the function zoom().

Note: This property is only used by the zoom() function. The integrated navigation buttons of the Maps EWO do not use the specified value.

Functions

Following functions are available for the Maps Widget:

Events

Following widget-specific events are available:

clicked(float lat, float lon, bool pan)

The event is triggered whenever the left mouse button is released, which means that it is triggered when clicking the map and when moving the map via panning. It provides the coordinates of the clicked position as well as an indication whether it was a pan or not.

clicked(float lat, float lon, bool pan)
{
  if (pan)
  DebugTN("panned at lat " + lat + " lon " + lon);
  else
  DebugTN("clicked at lat " + lat + " lon " + lon);
}

geoDataFileAdded(string fileName)

The event is triggered if a geoDataFile has been loaded using the function addGeoDataFile() and it provides the file name of the loaded file.

geoDataFileAdded(string fileName)
{
  DebugTN("geoDataFile has been added: " + fileName);
}

lineClicked(int layerId, int lineId)

The event is triggered whenever a line (added by using addLine()) is clicked on the map. It is only triggered for the topmost line, in case multiple lines are overlapping.

lineClicked(int layerId, int lineId)
{
  DebugTN("Line was clicked", layerId, lineId);
}

polygonClicked(int layerId, int polygonId)

The event is triggered whenever a polygon (added by using addPolygon()) is clicked on the map. It is only triggered for the topmost polygon, in case multiple polygons are overlapping.

polygonClicked(int layerId, int polygonId)
{
  DebugTN("Polygon was clicked", layerId, polygonId);
}

visibleBoxChanged(float north, float south, float east, float west)

The event is triggered as soon as the visible maps area changes. It provides the new coordinates on the edge of the visible area, like getVisibleBox(). The event is triggered multiple times while moving the map so that the correct coordinates are returned at every time.

visibleBoxChanged(float north, float south, float east, float west)
{
  DebugTN("visible box was moved to: ", north, south, east, west);
}