Mercurial > mxd2map
diff src/java/de/intevation/mxd/writer/MarkerStyleWriter.java @ 191:17b4aaa159ec
Added offset attributes to marker style symbols.
author | raimund renkert <raimund.renkert@intevation.de> |
---|---|
date | Wed, 20 Jul 2011 16:02:57 +0200 |
parents | 0bde090506f9 |
children | df4e0946ef02 |
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Wed Jul 20 16:00:22 2011 +0200 +++ b/src/java/de/intevation/mxd/writer/MarkerStyleWriter.java Wed Jul 20 16:02:57 2011 +0200 @@ -100,6 +100,32 @@ logger.warn("Error setting outline width."); } } + + if (symbolElement.hasAttribute("x_offset")) { + try { + double val = + Double.parseDouble(symbolElement.getAttribute("x_offset")); + double r = Math.round(val); + style.setOffsetx(r); + } + catch (NumberFormatException nfe) { + logger.warn("Error setting the symbol x-offset"); + } + } + if (symbolElement.hasAttribute("y_offset")) { + try { + double val = + Double.parseDouble(symbolElement.getAttribute("y_offset")); + double r = Math.round(val); + //In ArcGIS positive y offset values move the symbol upwards, + //in Mapserver positive values move downwards. + r = -r; + style.setOffsety(r); + } + catch (NumberFormatException nfe) { + logger.warn("Error setting the symbol y-offset."); + } + } String symType = symbolElement.getAttribute("style"); if(symType.equals("point") || symType.equals("arrow") ||