diff src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 46:34a93dad7604

Added MultiLayerMarkerSymbol(ArrowMarkerSymbol) support.
author Raimund Renkert <rrenkert@intevation.de>
date Mon, 18 Apr 2011 17:51:33 +0200
parents 9b5fb5e5914d
children 0fecdcc28b1b
line wrap: on
line diff
--- a/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Apr 18 16:03:07 2011 +0200
+++ b/src/java/de/intevation/mxd/writer/MapScriptWriter.java	Mon Apr 18 17:51:33 2011 +0200
@@ -215,7 +215,8 @@
                 for(int j = 0; j < count; j++) {
                     //TODO Find a way to create Expressions.
                     exp = "([" + classElement.getAttribute("expression_field_" + j);
-                    exp += "] = " + classElement.getAttribute("value") + ")";
+                    exp += "] " + classElement.getAttribute("expression_operator");
+                    exp += " " + classElement.getAttribute("value") + ")";
                 }
                 co.setExpression(exp);
             }
@@ -253,17 +254,18 @@
             style.setColor(color);
             style.setSize(Double.parseDouble(
                 symbolElement.getAttribute("size")));
-            Color oCol = Color.decode(
-                symbolElement.getAttribute("outline_color"));
-            colorObj outlineColor = new colorObj(
-                oCol.getRed(),
-                oCol.getGreen(),
-                oCol.getBlue(),
-                -4);
-            style.setOutlinecolor(outlineColor);
-            style.setOutlinewidth(Double.parseDouble(
-                symbolElement.getAttribute("outline_size")));
-
+            if(symbolElement.hasAttribute("outline_color")) {
+                Color oCol = Color.decode(
+                    symbolElement.getAttribute("outline_color"));
+                colorObj outlineColor = new colorObj(
+                    oCol.getRed(),
+                    oCol.getGreen(),
+                    oCol.getBlue(),
+                    -4);
+                style.setOutlinecolor(outlineColor);
+                style.setOutlinewidth(Double.parseDouble(
+                    symbolElement.getAttribute("outline_size")));
+            }
             String name = symbolElement.getAttribute("name");
             style.setSymbolByName(map, name);
             symbolObj sym = symbolSet.getSymbolByName(name);
@@ -276,6 +278,20 @@
                 sym.setPoints(points);
                 sym.setFilled(1);
             }
+            else if (symType.equals("arrow")) {
+                double len = Double.parseDouble(symbolElement.getAttribute("length"));
+                double width = Double.parseDouble(symbolElement.getAttribute("width"));
+                double ratio = len/width;
+                lineObj points = new lineObj();
+
+                points.add(new pointObj(0, 0, 0));
+                points.add(new pointObj((1*ratio), 0.5, 0));
+                points.add(new pointObj(0, 1, 0));
+                points.add(new pointObj(0, 0, 0));
+                sym.setType(MS_SYMBOL_TYPE.MS_SYMBOL_VECTOR.swigValue());
+                sym.setPoints(points);
+                sym.setFilled(1);
+            }
         }
         saveSymbolSet(symbolSet);
     }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)