[OpenLayers-Dev] Merkaartor style fileformat parser for OpenLayers

Peter Bex Peter.Bex at solide-ict.nl
Mon Dec 7 03:07:25 EST 2009

[cross-posting this to openlayers-dev mailinglist, please ignore
 any duplicates you may receive]

Hi all,

Since nobody responded to my previous e-mail to this list,
I've started to port the .MAS file loader from C++ to Javascript
so that it's now possible to load Merkaart style files (.MAS) into
OpenLayers.  This makes it easy to create styles in a WYSIWYG
fashion, right from Merkaartor's convenient style editor.

I've put my code online at Launchpad:

Unfortunately, Openlayers' styling facilities are much less rich
than Merkaartor's, so some style information is lost.  I tried to
stay as faithful to the output of Merkaartor, so I chose to follow
the style color "stack" of fillColor, backgroundColor, foregroundColor,
touchupColor in this order.  This ensures that the topmost "layer"
in the lines that Merkaartor draws are used.  For example, this means
that the borders that appear around a street in Merkaartor are not
shown OpenLayers.

Not all features are currently implemented, and it can only read
.mas-files, not write them.  I am not sure I will get around to
work on these, so if anyone is feeling particularly helpful, feel
free to help out ;)

Peter Bex
Solide ICT - http://www.solide-ict.nl

More information about the Dev mailing list