Custom POIs

From Navit's Wiki
Revision as of 14:46, 2 December 2011 by Ruedi (talk | contribs)
Jump to: navigation, search

Maybe you are interested in making some custom POIs. I was looking for this feature and couldn't find it for days - this is why I am now writing this page. This could be useful in the case you need to show points on a map for your business (clients places, shops, ... ) or for your free time. On the other hand bookmarks are not shown with an icon on the map.

Define your POI

Navit supports text files to be used. This is like bookmarks, but they will be used on the map.

First of all, go to your local .navit folder. Create a new file called my_pois.txt. There you can define your POIs like this:

        mg:8.497582 47.395690 type=poi_custom1   label="andys football field"

This will create a new POI with the type poi_custom1. You can use any type defined in item_def.h [1]

Using a custom icon

To display the new type defined in your my_pois.txt file you also need to define an icon for the new type. This will be done in the navit.xml in your local .navit folder.

Look for the itemgra definitions and add those lines:

     <itemgra item_types="poi_custom1" order="11-">
         <icon src="my_icon1.png"/>

A good place to add this line is after:

 <itemgra item_types="poi_fuel" order="10-">

You also need to make an icon and put it under /usr/share/navit/xpm/

Using the POI file with the map

I am using OSM maps so I added the following line in navit.xml:

               <mapset enabled="yes">
                       <map type="binfile" enabled="yes" data="/home/username/.navit/osm_bbox_eu.bin"/>
                       <map type="textfile" enabled="yes" data="/home/username/.navit/my_pois.txt"/>

Take care to put your correct username in the above path.