Help! mpgmap won't find my custom style

Mkgmap does not find my style files.

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


the style files are at

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.

my style files are at

I would be happy if someone could find what I have done wrong.



have you tried java -Xmx512M -jar mkgmap.jar --style-file=resources/mystyle

Thanks, Ligfietser!

I tried that as well. no success. :frowning:
Thanks anyway.

Anyone running mkgmap custom styles on windows ?


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

Sorry, my mistake. the style files are under resources\styles\mystyle\

I have tried both forward and backward \ / slashes.


Thats weird. You can try a full path,

Or else try to put the mkgmap settings in an txt file

java -Xms1024m -Xmx1024m -ea -jar mkgmap.jar -c osm_bnl.args

see an example of my osm_bnl.args here

Or maybe move the mystyle folder from the resources folder to another place will help?

I put the style directory right in the mkgmap “root” directory. It works now.

Thanks for your replies and advice!


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:
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

And it works. Sorry, I am relatively new to this.

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.