You are not logged in.
- Topics: Active | Unanswered
Announcement
Please create new topics on the new site at community.openstreetmap.org. We expect the migration of data will take a few weeks, you can follow its progress here.***
Pages: 1
#1 2011-02-02 10:30:37
- paanikki
- Member
- Registered: 2011-01-25
- Posts: 5
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
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.
my style files are at
www.nikkila.org/docs/mystyle.zip
I would be happy if someone could find what I have done wrong.
Thanks,
PaavoN
Offline
#2 2011-02-02 11:31:24
- ligfietser
- Member

- Registered: 2008-10-09
- Posts: 5,353
- Website
Re: Help! mpgmap won't find my custom style
have you tried java -Xmx512M -jar mkgmap.jar --style-file=resources/mystyle
Offline
#3 2011-02-02 11:41:22
- paanikki
- Member
- Registered: 2011-01-25
- Posts: 5
Re: Help! mpgmap won't find my custom style
have you tried java -Xmx512M -jar mkgmap.jar --style-file=resources/mystyle
Thanks, Ligfietser!
I tried that as well. no success. ![]()
Thanks anyway.
Anyone running mkgmap custom styles on windows ?
Last edited by paanikki (2011-02-02 12:04:31)
Offline
#4 2011-02-02 12:03:36
- ligfietser
- Member

- Registered: 2008-10-09
- Posts: 5,353
- Website
Re: Help! mpgmap won't find my custom style
--style-file=resources\mystyle
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
Last edited by ligfietser (2011-02-02 12:04:18)
Offline
#5 2011-02-02 12:08:43
- paanikki
- Member
- Registered: 2011-01-25
- Posts: 5
Re: Help! mpgmap won't find my custom style
--style-file=resources\mystyle
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.
PaavoN
Last edited by paanikki (2011-02-02 12:09:43)
Offline
#6 2011-02-02 12:29:28
- ligfietser
- Member

- Registered: 2008-10-09
- Posts: 5,353
- Website
Re: Help! mpgmap won't find my custom style
Thats weird. You can try a full path,
e:\osm\mkgmap-r1625\resources\styles\mystyle
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
http://mijndev.openstreetmap.nl/~ligfie … m_bnl.args
Offline
#7 2011-02-02 12:35:36
- ligfietser
- Member

- Registered: 2008-10-09
- Posts: 5,353
- Website
Re: Help! mpgmap won't find my custom style
Or maybe move the mystyle folder from the resources folder to another place will help?
Last edited by ligfietser (2011-02-02 12:36:08)
Offline
#8 2011-02-02 15:18:29
- paanikki
- Member
- Registered: 2011-01-25
- Posts: 5
Re: Help! mpgmap won't find my custom style
I put the style directory right in the mkgmap "root" directory. It works now.
Thanks for your replies and advice!
PaavoN
Offline
#9 2011-02-02 17:58:45
- ligfietser
- Member

- Registered: 2008-10-09
- Posts: 5,353
- Website
Re: Help! mpgmap won't find my custom style
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".
Offline
#10 2011-02-12 05:49:45
- csdf
- Member
- From: UK, living in Abu Dhabi
- Registered: 2009-08-11
- Posts: 313
- Website
Re: Help! mpgmap won't find my custom style
--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.
Offline
#11 2011-02-24 09:55:36
- herrbert74
- Member
- Registered: 2011-02-23
- Posts: 9
Re: Help! mpgmap won't find my custom style
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?
Offline
#12 2011-02-24 10:26:11
- herrbert74
- Member
- Registered: 2011-02-23
- Posts: 9
Re: Help! mpgmap won't find my custom style
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.
Offline
#13 2011-02-24 18:47:07
- csdf
- Member
- From: UK, living in Abu Dhabi
- Registered: 2009-08-11
- Posts: 313
- Website
Re: Help! mpgmap won't find my custom style
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.
Offline
Pages: 1