Maps Widget Example - Google Maps Integration

This chapter demonstrates how Google Maps map material can be integrated into your Maps Widget instance.

How-To

Following steps must be taken to integrate Google Maps into your Maps Widget.

  1. Download a corresponding DGML file and all associated resources. These files can either be created on your own or downloaded from e.g. https://github.com/freayd/marble-maps.

    Please note, that the usage inside of your project requires additional legal steps on your side (Google Maps Development/Usage License, etc.).

  2. Place the downloaded files into your projects data/maps/maps/earth/<ThemeId> folder, e.g. "data/maps/maps/earth/google-maps-satellite/" . If the structure data/maps/maps/ is not yet available inside your project it must be created manually. Please note that ThemeId and the .dgml file name must be identical. For "google-maps-satellite" the structure should be identical to following structure:
    data/maps/maps/earth/google-maps-satellite/
    data/maps/maps/earth/google-maps-satellite/0/
    data/maps/maps/earth/google-maps-satellite/0/0/
    data/maps/maps/earth/google-maps-satellite/0/0/0.jpeg
    data/maps/maps/earth/google-maps-satellite/google-maps-satellite.dgml
    data/maps/maps/earth/google-maps-satellite/google-maps-satellite-preview.png
    data/maps/maps/earth/google-maps-satellite/legend.html

    There are several types of themes for Google Maps that can be used and each of them requires a separate ThemeId folder within the /data/maps/maps/earth/ directory:

    data/maps/maps/earth/google-maps/..
    data/maps/maps/earth/google-maps-satellite/..
    data/maps/maps/earth/google-maps-terrain/..
  3. Create a new panel within your project containing a Maps Widget or open an already existing panel.
  4. Load the map theme using the property mapThemeId of the Maps_Widget by stating the path to the .dgml file, e.g.: "earth/google-maps-satellite/google-maps-satellite.dgml"
  5. Set the workOffline property to "false" to enable map updates from the internet.
  6. Open the Panel and the Widget will start to download the necessary tiles to display the map for your current altitude and viewable area, see example image below.
Figure 1. Maps Widget - Google Maps