[Merkaartor] Patch: Style: Icon path relative to style file

Yves Goergen nospam.list at unclassified.de
Tue Jan 6 15:21:20 GMT 2009


If you select an icon to be drawn in a style, you can select some
cryptic name from the internal representation of the more or less
organised embedded icons. The file structure can only be known if you
look hard into the source code. If you want to create or edit your own
style and use more icons, it's very hard to enter these virtual file
names. Supplying your own files is also hard, because you need to enter
absolute pathnames. But how do you know where somebody will copy the
images to your style? (Absolute path names can never be portable.)

Here's the solution: If the icon filename specification does not contain
a backslash or slash (both are required features of an absolute path
specification), the path of the style file is prepended. So you can just
enter the icon's filename without a path, copy it in the same directory
as your style (.mas) file (or in a subdirectory) and you're done.

The current situation is that if you don't enter an absolute path, the
icon is loaded from the current directory - whichever that is. (At least
that's what I suppose after reading the original source code. I haven't
bothered finding out where that path is.)

I'm currently editing the MapnikPlus style to add more icons and replace
some. Since I find embedding icons too complicated with the given Qt
toolset, I'd rather copy them as separate files next to the .mas file.
This also has the effect that the style is fully portable and can be
given to and edited by other Merkaartor users, including all icons.

-- 
Yves Goergen "LonelyPixel" <nospam.list at unclassified.de>
Visit my web laboratory at http://beta.unclassified.de
-------------- next part --------------
A non-text attachment was scrubbed...
Name: style-icon-path.zip
Type: application/zip
Size: 1511 bytes
Desc: not available
URL: <http://lists.openstreetmap.org/pipermail/merkaartor/attachments/20090106/d6a71a1f/attachment.zip>


More information about the Merkaartor mailing list