Right now SVG markers are placed on the center of the SVG object itself. (Mapnik calculates the bounding rect of all paths of the SVG). That way SVG markers are always centered, but this makes it impossible to place arrow like markers to point to an exact location.
A simple solution to place arrow-like markers is to create a larger SVG canvas and point the tip of the arrow to the center of the large canvas. That does work great with OpenLayers or MapFish Print, but not with Mapnik.
I did a quick hack to read the actual SVG canvas size from the XML, instead of calculating it, and it works great. See here:
Unfortunately, the bounding rects are calculated inside the marker cache, so it is not easy to make this an option for the PointSymbolizer. Or am I missing something? What would be the best way to add this behavior?
Thanks for the patch! I see the problem. Looks like we might need different 'lazy' strategies for bounding box calculation.
@artemp - see also #1137 when you get a chance to dig into this one.
parse and setup ability to known original, declared svg width/height …
…- refs #1122
work above added that starts to parse width/height. TODO - need to also look into getting viewBox and then considering doing something with this into/adding options.
some of the work added in 76042a1 rolled back after fixing the regression as detailed at #1849