Difference between revisions of "Custom POIs"

From Navit's Wiki
Jump to: navigation, search
Line 42: Line 42:
  
 
Take care to put your correct username in the above path.
 
Take care to put your correct username in the above path.
 +
 +
 +
=Load POIs via CSV=
 +
 +
This can be useful to load POIs from a camping guide like Bordatlas or ADAC Camping Caravaning Führer. Most of them provide the camping sites mentioned in their books via CSV. To use this feature you need to compile navit with the parameter  ''--enable-map-csv''. Have a look at  [[Navit_csv_format | Navit_csv_format]].
 +
 +
But same as above, you can add a custom type to it if you use something like item_type="poi_custom1" (on the line where you add the CSV to your mapset).
 +
  
  

Revision as of 16:12, 2 December 2011

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"/>
     </itemgra>

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"/>
               </mapset>

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


Load POIs via CSV

This can be useful to load POIs from a camping guide like Bordatlas or ADAC Camping Caravaning Führer. Most of them provide the camping sites mentioned in their books via CSV. To use this feature you need to compile navit with the parameter --enable-map-csv. Have a look at Navit_csv_format.

But same as above, you can add a custom type to it if you use something like item_type="poi_custom1" (on the line where you add the CSV to your mapset).


Sources

http://trac.navit-project.org/ticket/735

http://wiki.navit-project.org/index.php/Other_maps