4. Configuration

Navit is highly modular and customizable. This page aims to point out the most common options which a first-time user may want to change - power users may want to consult [[Configuration/Full_list_of_options | the full list of options]]. It is also possible to edit the navit.xml file for your Android device under Windows and Linux (Debian/Ubuntu derivates) with a third party application called [[NavitConfigurator]].

Setting up Navit is done by editing a configuration file called “navit.xml”. Editing XML configurations files in a text editor is simple, they are just plain text XML files, that can be edited with any editor. Just remember to ‘’turn off ‘save UTF8 byte mark’ in Preferences’’ or navit may complain very much on the first byte of the file.<br> The XML configuration file is splitted into sections within a hierarchy:

<config>
        <plugins></plugins>
        <navit>
                <osd></osd>
                <vehicle></vehicle>
                <vehicleprofile></vehicleprofile>
                <mapset></mapset>
                <layout></layout>
        </navit>
</config>

Navit comes preshipped with a default navit.xml together with navit_layout_*.xml files that are stored at various locations (depending on your system).

For Linux-like OSes:
  • in ~/.navit/: e.g: /home/myusername/.navit/navit.xml (This is probably to best place to customize your settings!)
  • in /usr/share/navit or /etc/navit
Navit will apply settings in the following order:
  • in the current directory (used on Windows)
  • location supplied as first argument on the command line, e.g.: navit /home/myusername/navittestconfig.xml (Used mainly for development)
  • in the current directory as navit.xml.local (Used mainly for development)

{{note|In any case, you have to adapt settings to your system!<br> This includes especially GPS, map provider and vehicle: [[Basic configuration]]}}

5. Configurable Sections

5.1. General

Common options such as units, position, zoom and map orientation, … be configured in this section.

5.1.1. General Options

Settings which affect Navit’s general behaviour are located within the <navit .. > tag. In a default installation, this is found on line 31 of navit.xml. By default, the navit tag is set as follows:

<navit center="4808 N 1134 E" zoom="256" tracking="1" orientation="-1" recent_dest="10">

Some common attributes are discussed below. For more advanced features, see [[Configuration/Full_list_of_options | the full list of options]].

5.1.1.1. Initial map position

On Navit’s very first startup, it needs a center to look at on the map. By default this is set to Munich in Germany, which is conveniently covered by the sample map created on installation.

center="11.5666 48.1333"

Coordinates can be written in different formats; see [[Coordinate_format]] for the full list. To determine a specific latitude and longitude for your location you can use http://itouchmap.com/latlong.html. Usually, changing the “center” setting is not necessary, since it is only used during the first start. On subsequent starts, Navit will remember the last map position (stored in “center.txt”) and ignore the “center” setting.

When Navit starts, it will display the map at a pre-defined zoom. The default zoom level is 256. The lower the value, the closer you will be zoomed in. <!—what does the zoom number express? How can I estimate it?–>

zoom=”256”

For those using the [[SDL GUI]], a level of 128 is recommended.

zoom=”128”

Note that once Navit has started, the zoom level can be altered using [[OSD]] or menu items.

Use the orientation attribute to orient the map in either the direction of travel, or oriented North. .To orient the map in the direction of travel:

orientation=”-1”

or to orient North:

orientation=”0”

Orienting the map North whilst in [[3D]] mode will provide visually confusing results, and is not recommended. When in 3D mode, it’s best to have the map oriented in the direction of travel.

5.1.1.2. Autozoom

Navit has the ability to autozoom the map in or out dependent upon your speed.

autozoom_active=”1”

To de-activate autozoom:

autozoom_active=”0”

5.1.1.3. 3D pitch

Navit has the capability to display either a 2D map (bird’s eye perspective) or a [[3D]] map (some amount of tilt looking to the horizon). Navit’s default configuration is to startup in the 2D perspective but it is possible to specify that Navit start with a 3D perspective. The amount of tilt is specified by setting the value of <tt>pitch</tt>.

The pitch value defines default camera tilting, with a value from 0 to 359. Note that usable values lie between 0 and 90 where 0 is bird’s eye perspective looking down and 90 is human perspective looking forward. Also note that values closer to 90 will slow down map drawing, because the line of sight gets longer and longer and more objects are seen.

For example, the following added to the <tt>navit</tt> tag will force Navit to start with a pitch of 30 degrees:

pitch=”30”

5.1.1.4. Imperial units

By default, Navit use the metric system of measurements when displaying or announcing distances, speeds etc. However, you can configure Navit to display and announce these values in imperial units. Simply add an <tt>imperial</tt> attribute to the Navit tag, and set its value to 1, as shown below:

imperial=”1”

Speeds should now be displayed in units of miles-per-hour, whilst distances are converted to miles (large distances) and feet (small distances).

5.1.1.5. Default layout

When no specific layout has been specified by the user, navit uses a default layout to draw maps. The <tt>default_layout</tt> attribute of the navit tag allows to specify which layout to use as default;

default_layout=”Car”

This string should match the <tt>name</tt> attribute of the required <tt><layout></tt> tag.

See [[Configuration/Layout_Options| layout options]] for more details. [[Category:Customizing]] [[Category:Configuration]]

5.2. Display

A large number of display properties can be configured, including desktop or touchscreen-optimised GUIs, on-screen display items and complete control over menu items.

5.2.1. Display Options

The Navit display is highly customisable and consists of the following components

  • Graphics driver (appropriate engine for your system, to draw everything)
  • GUI (enables user interaction and map display)
  • OSD (shows widgets on map screen)

5.2.1.1. Graphics Driver

Different technologies can be used, to let Navit draw it’s visual components. Not all might be available at your specific system

The current list of available graphics drivers:

  • android, for the Android port
  • cocoa, for the iPhone port
  • gtk_drawing_area, usually most appropriate on Linux desktop systems
  • sdl, render inside an X window, or direct to the Linux framebuffer, with min dependencies on external libraries.
  • qt5, render using Qt5 library, either using QWidgets or QML. On top of any Qt5 supported display technology.
  • win32 - useable with <tt>gtk</tt> or <tt>internal</tt> GUIs for Windows systems only.

Experimental/less maintained drivers:

  • qt_qpainter, render inside X window or on top of Qt Palmtop Environment.
  • opengl, rendering via OpenGL
  • gtk_gl_ext, rendering via OpenGL using GTK+ OpenGL extension
  • gd, rendering using the GD Graphics Library

They can be activated and configured as following:

<graphics type="gtk_drawing_area" />

As mentioned, it’s usually best to leave this as whatever the default is within your navit.xml, and only mess around with it if you know what you are doing, or have been told to by one of the developers.

5.2.1.2. Graphical User Interface

You can now choose which type of GUI you would like to use with Navit. Not all GUIs work with all Graphics drivers

GUI android cocoa gd gtk_drawing_area gtk_gl_ext opengl qt_qpainter sdl win32 qt5 preview
GTK                      
Internal Yes Yes Yes Yes Yes Yes Yes Yes Yes Yes  
QML2                      
5.2.1.2.1. Generic GUI Options

There are some options available for the gui tag which are used by all the GUI types. These include:

  • fullscreen - Enables Navit to start in fullscreen mode.
  • pitch - The pitch value to pitch the map to when selecting 3D mode from the menus.
  • dimensions - w=”1024” h=”600”

The following example uses the internal GUI, and starts Navit up in fullscreen mode, and will pitch the map to 35 degrees when 3D mode is selected from the menu. Note that to start Navit in 3D mode by default, [[#Initial 3D pitch|change the pitch value in the navit tag]]:

<gui type="internal" enabled="yes" fullscreen="1" pitch="35">
5.2.1.2.2. Internal GUI

The first GUI is embedded in Navit core and is primarily aimed at [[touchscreen]] devices, or those devices with small screens (such as netbooks). However, this GUI also works very well on desktops and laptops.

<gui type="internal" enabled="yes">
5.2.1.2.2.1. Options

A number of options specific to the internal GUI are available. These include:

  • font_size - Base text size to use within the internal menu.
  • icon_xs - The size that extra-small style icons should be scaled to (e.g. country flag on town search).
  • icon_s - The size that small style icons should be scaled to (e.g. icons of internal GUI toolbar).
  • icon_l - The size that large style icons should be scaled to (e.g. icons of internal GUI menu).
  • menu_on_map_click - Toggles the ability to bring up the menu screen when clicking on the map. See the [[Internal_Gui#Menu_Configuration|``internal`` GUI page]] for more information.

An example gui tag using the previous options is shown below:

<gui type="internal" enabled="yes" font_size="250" icon_xs="48" icon_s="48" icon_l="64">

More options are discussed on the [[Internal Gui]] and the [[Configuration/Full_list_of_options|full list of options]].

5.2.1.2.3. GTK GUI

The second GUI is called gtk, and is most useful for those users who wish to use a traditional windowed GUI. This is one useful to desktop use.

<gui type="gtk" enabled="yes" />
5.2.1.2.3.1. Options

A number of options specific to the gtk GUI are available. These include:

  • menubar - enable/disable the menubar
  • toolbar - enable/disable the toolbar
  • statusbar - enable/disable the statusbar
<gui type="gtk" enabled="yes" menubar="1" toolbar="1" statusbar="1"/>

5.3. Vehicle

A number of vehicles can be defined within Navit, depending upon the device and/or operating system in use. Vehicle profiles for routing (eg: car, pedestrian, bicycle…) are also completely configurable.

5.3.1. Vehicle Options

It’s important to understand the separate but linked Navit concepts of a vehicle and [[Vehicleprofile| vehicleprofile]] element. A vehicle defines the source of positional data (suchas a USB GPS device), and how to present that data to the user on the map, where the vehicleprofile defines all aspects of routing.

A simple vehicle definition looks like this:

<vehicle name="My" enabled="yes" source="file://dev/ttyS0" active="1"/>

Here some of the available options: * active: If set to 1, makes the vehicle the default active one. Routing, view centering and map redraw would be applied to this one by default. * enabled: If set to yes, Navit connects to the vehicle data source and shows the vehicle on the map. * follow: map follows after “n” gps updates (where n=0 means only when the vehicle leaves the map->saving CPU time) * source : source of GPS (required) * profilename: link the vehicleprofile for this vehicle.

<!– do we need to keep this keys or note them elsewhere? Obsolete options: * update: This will force the map to be recentered at your main cursor’s position. * color/color2: The color of the cursor is now specified within the cursor tag itself. * animate: If set to 1, the cursor will be animated as a moving dotted line, to make it easier to see. –>

5.3.1.1. GPS

Most essential detail is the gps source, that need to be adapted to your local setup.

Local:

Windows: * source=”serial:COM2 baud=4800 parity=N data=8 stop=1” ** For Locosys GT31 (or BGT31 plugged by USB), settings are: source=”serial:COM3 baud=38400 parity=N data=8 stop=1” where COM3 should be replaced by the correct COM over USB number.

Windows Mobile: * source=”wince:GPD1:” - using the internal GPS driver, configured from Windows Remote GPS Settings. ** To use a BT GPS it must be configured as outgoing com port and paired, then selected as hardware port in GPS Settings. ** To start bluetooth on navit startup add bluetooth=”yes”. When exiting navit, the previous bluetooth state is recovered. * source=”wince:COM1:” baudrate=”57600”

There is useful [http://w5.nuinternet.com/s660100031/SirfTech.htm. SirfTech utility] that can automatically scan existing serial ports trying different baudrates to detect GPS source.

Linux: * source=”file:/dev/rfcomm0” - BlueTooth GPS * source=”file:/dev/ttyS0” - serial GPS connected to the first serial port (you may need to add the correct baudrate eg.: freerunner source=”file:/dev/ttySAC1” baudrate=”9600”) * source=”gpsd_dbus:” - via dbus, position reported by gpsd

Network based: If you want to connect multiple tools to your GPS, you need an multiplexer tool, as gpsd or gypsy. * source=”gpsd://host[:port]” - gpsd://localhost, the default one, will try to connect to gpsd on localhost * source=”socket:ipaddr:post” - socket connection (expects nmea stream) * source=”socket:ipaddr:2947:r=1” - connect to gpsd in nmea mode (gpsd versions 2.39 or older) * source=’socket:ipaddr:2947:?WATCH={“enable”:true,”nmea”:true};’ - connect to gpsd in nmea mode (gpsd versions newer than 2.39) * source=”gypsy://connectstring” - gypsy

Tricks: * source=”file:/home/myhome/mynmea.log” : here, navit will replay the nmea logfile (under Windows it is currently not possible in Navit) * source=”pipe:/usr/bin/gpspipe -r” - any executable that produces NMEA output - gpsbabel, gpspipe, … * source=”demo://” : to use the demo vehicle. Set your Position and Destination, and vehicle will follow the calculated route. Useful if you have no nmea data source. * source=”null://” : no GPS at all

5.3.1.2. Logging tracks

To record your trip , you can add a sub-instance “log” to the vehicle. It is possible to add multiple logs.

<log type="gpx" data="track_%Y%m%d%i.gpx" flush_size="1048576" flush_time="900" />
<log type="nmea" data="track_%Y%m%d%i.nmea" flush_size="1048576" flush_time="900" />

This will give a log file named YearMonthDaySequencenumber.gpx/.nmea which will be kept in memory and flushed to disk when it is 1048576 bytes large or the oldest data is older than 900 seconds. <!–how to define, where the file get’s stored?–>

To display your track for more than one hour, you must use [[binfile]] to create a cache file that get’s display <!–do I need to add it as a map source?–>

<log type="binfile" data="track.bin" flush_size="0"/>

For customizing what is stored, see [[GPX]]

5.3.1.3. Vehicleprofile

[[Vehicleprofile | Profiles to add in the navit.xml]] <br/> <!– this is tricky, here we need a step by step introduction–> Defines the behaviour of the routing and are usually linked to a vehicle section, so switching the “vehicle” (type of mobility) from within Navit, routing also will change its behaviour. This way, it is possible to include steps for pedestrian routing, but to exclude it for bike, horse or car routing. Within the vehicleprofile section, roadprofile sections are used to describe the routing behaviour of different roads. Here’s a very basic example:

<vehicleprofile name="bike" flags="0x40000000" flags_forward_mask="0x40000000" flags_reverse_mask="0x40000000" maxspeed_handling="1" route_mode="0">
  <roadprofile item_types="path,track_ground" speed="12" route_weight="5">
  </roadprofile>
  <roadprofile item_types="track_gravelled,track_paved,cycleway,street_service,street_parking_lane,street_0,street_1_city,living_street,street_2_city,street_1_land,street_2_land,street_3_city" speed="25" route_weight="15">
  </roadprofile>
  <roadprofile item_types="roundabout" speed="20" route_weight="10"/>
  <roadprofile item_types="ferry" speed="40" route_weight="40"/>
</vehicleprofile>

For details on the flags, see [[Vehicle profile flags]]. The speeds are in km/h.

Only the vehicle profile names “car”, “bike” and “pedestrian” are translated in the GUI.

[[Category:Customizing]] [[Category:Configuration]]

5.4. Maps

You can use maps from a variety of sources, any number of maps can be configured and enabled at any one time.

5.5. Layout

Maps are displayed according to the rules defined in the layout. All aspects of the layout are configurable, from POI icons to colours for a particular type of highway.

For all versions shipped after nov 2018, layout XML configuration is stored in dedicated XML files called with the prefix ´´navit_layout_´´ (one file per layout definition).

5.5.1. Layout Options

5.5.1.1. Layouts

A layout defines how to render a map. Layouts are fully customisable, from the road colours and widths to size and type of icons to display for specific POIs. The layout is also where the cursor (i.e. the shape which shows where you are) is defined.<br> A number of user-generated layouts and cursor definitions are available at [[Layout]].

5.5.1.2. Defining layers

A layout consist of one cursor and one or more layers which are each a set of rules on how and when to draw certain items. Those rules are called itemgra. The layers are rendered one by one in the order they appear in the XML config file, as are the items in each layer. If you can’t see an item make sure there is not another one hiding it. If your item is hidden, you can move your item further down in the layout section of the file.

<layout name="Demo layout" color="#ffefb7" font="Liberation Sans" active="1">
       <cursor w="26" h="26">
       <layer name="layer_1">
               <itemgra item_types="water_poly" order="0-">
                       <polygon color="#82c8ea" />
                       <polyline color="#5096b8" />
                </itemgra>
       </layer>
<layout>

Here the available options: * item_types: Comma separated list of items (see navit/item.h for definitions) * order: Range for zoom levels. * speed_range: Range for vehicle speed, useful for cursors. * angle_range: Range for pitch angle. * sequence_range: Useful for animated cursors.

For infos about map icons, see [[Icons]]

5.5.1.3. Overriding default (shipped) layouts

When the XML config file is parsed, layouts are taken in the order they come, and a layout with an already existing name overrides a previous definition. The default (shipped) navit.xml includes first system-wide navit_layout_*.xml files then the user-specific navit_layout_*.xml files, so the system-wide navit_layout_*.xml files can be overiden by adding a user-specific navit-layout_*.xml containing the same name attribute.

Copying the default navit.xml file to the user-specific location will still use the default shipped layout files, but copying one or several layout files as well to the user-specific location (and modifying them) allow to override these specific layouts.

5.5.1.4. Note on the default layout used by navit

When no layout has been specifically selected by the user (for example at first startup), navit will use the default layout specified (see [[Configuration/General_Options#Default_layout|the related section to know how to configure this]]).

5.5.1.5. Using a layer in multiple layouts

Sometimes, multiple layouts can use the same layer. For example, a reduced layout for a cleaner map may use the same layers as the regular layout, just not all of them.

To use a layer in multiple layouts, it can be referenced using the ref attribute. In place of the regular layer definition, use an empty tag with only the attributes ‘’name’’ and ‘’ref’’:

<layer name="Found items" order="0-">
  <itemgra item_types="found_item">
      <circle color="#008080" radius="24" width="2" text_size="12"/>
  </itemgra>
</layer>
[...]
<layout name="Demo layout">
  [...]
  <layer name="Found items for demo layout" ref="Found items" />
  [...]
</layout>
<layout name="Demo layout reduced">
  [...]
  <layer name="Found items" ref="Found items" />
  [...]
</layout>

Note that the layer you want to reuse must be placed ‘’outside’’ the layout. Layers defined inside a layout cannot be reused in this way.

[[Category:Customizing]] [[Category:Configuration]]

5.6. Advanced

There are many more options, including debugging, specific plugins, speech announcements, trip logging, …

5.6.1. Advanced Options

The rest of this webpage is meant for advanced/power users who’d like to fiddle a little more under-the-hood. The average user can safely ignore this section!

5.6.1.1. Speech

Navit can announce driving directions with voice. Navit can use different mechanisms to play these announcements. Note that not all tools are available on all platforms.

5.6.1.1.1. Prerecorded samples

Navit is able to compose phrases if you give it a set of prerecorded samples. Configuration example:

<speech type="cmdline" data="aplay -q %s"
sample_dir="/path/to/sampledir" sample_suffix=".wav" flags="1"
vocabulary_name="0" vocabulary_name_systematic="0" vocabulary_distances="0"/>

The directory ‘’sample_dir’’ should contain audio files. ‘’sample_suffix’’ is the common file type suffix of those files. The names of the files (without the suffix) must correspond to the text they contain. For each text it wants to speak, Navit will look for one or more sample files with corresponding names (ignoring upper/lower case). So for “turn right in 300 meters” you could use turn.wav, right.wav, in.wav, 300.wav, meters.wav. Navit will prefer files that contain multiple words: If file “turn right.wav” is present, it will be used even if you have turn.wav and right.wav.

Note that Navit internally handles all text in UTF-8 encoding. If you use a file system where file names are not encoded with UTF-8 (such as Windows), Navit will only find files for ASCII text. If you use a language that uses non-ASCII characters, the file name must be the [http://en.wikipedia.org/wiki/Percent-encoding percent encoding] of the UTF-8 representation of the text. For example the filename for “süd” would be “s%c3%bcd.wav” (because “ü” is encoded as C3BC in UTF-8). For this feature to work, you must set ‘’flags’’ to 1.

‘’data’’ is the program that can be used to play the sample files. You should specify the program name along with any necessary parameters. The placeholder “%s” will be replaced with the file(s) to be played. All files required for a text will be passed in one go, so the program will need to support playing multiple files. Note that the %s should ‘’not’’ be quoted; the text is not passed through a shell.

Note that if any file that is needed to compose the complete phrase is missing then Navit will be silent. In that case a warning will be printed. Unfortunately, there is no complete list of the samples required. However, all the navigation text is contained in the translation files (.po files), so you can get a rough list.

By default Navit is trying to announce street names. To disable this feature you can set ‘’vocabulary_name’’ and ‘’vocabulary_name_systematic’’ to 0 in the speech tag which will specify that the speech synthesizer isn’t capable of speaking names. Also there is ‘’vocabulary_distances’’ which you can set to 0 so only the minimum set of 1,2,3,4,5,10,25,50,75,100,150,200,250,300,400,500,750 as numbers is used.

5.6.1.1.2. espeak
<speech type="cmdline" data="espeak -s 150 -v english_rp %s"/>

Will use espeak instead, for those who want Navit to speak to them in English, at 150 words per minute. The ‘’%s’’ is filled in by Navit when sent to the speech synthesis software (with something like “Turn left” or whatever is appropriate at the time). If you need more features, you should use an external wrapper script which can contain anything supported by your shell (see [[Translations]]).

5.6.1.1.3. festival
5.6.1.1.4. flite
5.6.1.1.5. Mbrola
5.6.1.1.6. Android
<speech type="android" cps="15"/>
5.6.1.1.7. Start up in silent mode

To have Navit start up in silent mode, insert <code>active="0"</code> somewhere in your <code>speech</code> tag. For example on Android:

<speech type="android" cps="15" active="0"/>

In this case, you should place a <code>toggle_announcer</code> item in your [[OSD]] configuration, or add a menu item so you can enable speech output when you need it.

5.6.1.2. Splitting navit.xml

Navit has support for a small subset of XInclude / XPath for including parts of external XML files. Supported is a tag like

<xi:include href="some_file" xpointer="xpointer_stuff" />

You can leave out either href (xi:include refers to the same file it is in then) or xpointer (xi:include then refers the complete file), but not both. The ‘’href’’ attribute refers to a file relative to the current directory. It is suggested to use the complete path, such as ‘’/home/root/.navit/navit-vehicles.xml’’.

href is expanded with wordexp internally, so you can do stuff like:

<xi:include href="$NAVIT_SHAREDIR/maps/*.xml" />

Some examples on the supported syntax: .. code-block:: xml

<xi:include xpointer=”xpointer(/config/navit/layout[@name=’Car’]/layer[@name=’points’])” />

references to the XML-Tag “layer” with attribute “name” of value “points” within an XML-Tag “layout” with attribute “name” of value “Car” within an XML-Tag “navit” within an XML-Tag “config”.

<config xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/*[name(.)!='navit'])"/>
<navit center="4808 N 1134 E" zoom="256" tracking="1" cursor="1" orientation="0">
<xi:include href="$NAVIT_SHAREDIR/navit.xml" xpointer="xpointer(/config/navit/*[name(.)!='vehicle'])"/>
</navit>
</config>

Use this as your $HOME/.navit/navit.xml and you will get everything under <config>..</config> except <navit>..</navit> (first xi:include), plus <navit> as specified plus everything from navit within config, except the vehicle definitions (second xi:include).