E:\osm>cd mkgmap-r1625
E:\osm\mkgmap-r1625>java -Xmx512M -jar mkgmap.jar --style-file=mkgmap-r1625/resources/styles/mystyle
E:\osm\mkgmap-r1625>java -Xmx512M -jar mkgmap.jar --list-styles
The following styles are available:
default 1.0: The default style
marine 1: Default style + marine objects
noname 1: Special map to highlight roads with no name
test 1: No summary available
E:\osm\mkgmap-r1625>
the style files are at
e:\osm\mkgmap-r1625\resources\mystyle\
there is a version-file with “0” in it, so it should be “visible” to mkgmap.
I have tried to write the path in different formats, but nothing helps.
perhaps it makes a difference with forward or backward slashes \ or / ?
Are you sure you put the folder mystyle direct under resources? In your javascript example you set it in resources/styles/mystyle
Good to hear that this did the trick.
Maybe its a bug, that custom styles won’t work in the resources folder?
The latest versions of mkgmap have no such folder anymore, its renamed to “examples”.
–list-styles is a pointless option. It only lists the styles that are built into the mkgmap.jar It will not list your own styles unless you go into acrobatics to try to get it to do so. All that matters is that mkgmap uses your style (with the --style-file=foo/path/ option) when it builds the map - and you can test this easily by (for instance) creating a style with no lines in it.
This is definitely a bug, and an old one: http://wiki.openstreetmap.org/wiki/Talk:Mkgmap#Styles
Whereever I put my styles it won’t work. It uses the default style, without any warning. I have to rename the jar file to a zip, change the default, then rename it again every time I change my style. It’s really daunting.
Is any developer reading this? I spent several hours to find this out while this is only a few lines in the code, I suppose.
Paanikki, what was the full path you put your style and the exact order you used?
I found the problem. The options have to precede the path of the osm file. So instead of:
java -jar mkgmap.jar c:\osm\osmfiles\rezi-keszthely.osm --style-file=c:\osm\mkgmap\styles\herrbert
I used:
java -jar mkgmap.jar --style-file=c:\osm\mkgmap\styles\herrbert c:\osm\osmfiles\rezi-keszthely.osm
Yes, the way the options work, they are applied to whichever file postcedes them in the command line, so you need to call the options first, then the file(s) you want the options to apply to.