San Vicente map MapGazer – MapGazer templates


Download MapGazer

Getting started

Using marks:
   Mark properties

Using the Scale

Using icons

Using transparency

General settings

Getting maps

Using map tools

Elevation data

Coordinate formats

GPX files

Command line


When MapGazer saves marks (tracks, routes, and waypoints), the marks are saved in a GPX (Global Positions eXchange format) file. GPX files are ‘plain text’ files using eXtensible Markup Language (XML) to mark up the data. Most applications that create GPX files add various extensions; the extensions augment the basic data defined for GPX files with additional features – for example, the colour to use for a track, route, or waypoint.

Many of these extensions are poorly documented, and when saving data MapGazer cannot automatically create a valid output GPX file purely from the geographical data, especially when the data loaded was recorded by different devices or applications, or was created by MapGazer itself (e.g., a new route).

Instead, MapGazer uses MapGazer templates. These are simply GPX files with a special empty tag:


in place of the usual track, route, or waypoint elements.

When marks are saved:

  • MapGazer initializes the saved file with everything in the template file that precedes the <mapgazer:template/> tag.

  • The marks are then written using the original GPX data and extensions, as available, except for data values that you modified or created (for example, moving a waypoint or changing its icon, or creating a new route).

  • Finally everything in the template that follows the <mapgazer:template/> tag (usually just whitespace and the </gpx> end tag) is written after the marks.

Custom MapGazer templates

You can create your own templates, for example to add XML namespaces (xmlns) or metadata. It is often easiest to start with a copy of an existing GPX file and simply replace its data elements with the special tag described above. Templates must include the XML declaration (<?xml ... ?>) and the gpx start and end tags.

To load a custom template, use the usual Marks → Load marks from GPX file menu item (or press the ‘L’ key). If the loaded GPX file is a valid template (that is, it has no marks, it includes the special <mapgazer:template/> tag, and it has no errors) it becomes the current template file; this is confirmed after loading.

The current template will then be used whenever marks are saved until a different template is loaded. The specification of the current template is saved across MapGazer runs, so you do not need to load it every time you start MapGazer.

Note: do not modify the provided (default) MapGazerTemplate.gpx file, because this will be overwritten when MapGazer is updated. Instead, make a copy with a different filename and modify that.

MapGazer and these web pages were written by Mike Cowlishaw; Please send me any corrections, suggestions, etc.
All content © Mike Cowlishaw, 2014–2017, except where marked otherwise. All rights reserved. The pages here, and the MapGazer program, are for non-commercial use only. Privacy policy: the Speleotrove website records no personal information and sets no ‘cookies’. However, statistics, etc. might be recorded by the web hosting service.

This page was last updated on 2016-10-28 by mfc.