Mercurial > mxd2map
comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 97:18e4f143896b
Added polygon writer.
author | Raimund Renkert <rrenkert@intevation.de> |
---|---|
date | Mon, 06 Jun 2011 17:24:43 +0200 |
parents | c285ed08b72c |
children | 4696d0769f9c |
comparison
equal
deleted
inserted
replaced
96:c285ed08b72c | 97:18e4f143896b |
---|---|
168 if(type.equals("point")) { | 168 if(type.equals("point")) { |
169 layer.setType(MS_LAYER_TYPE.MS_LAYER_POINT); | 169 layer.setType(MS_LAYER_TYPE.MS_LAYER_POINT); |
170 } | 170 } |
171 else if (type.equals("line")) { | 171 else if (type.equals("line")) { |
172 layer.setType(MS_LAYER_TYPE.MS_LAYER_LINE); | 172 layer.setType(MS_LAYER_TYPE.MS_LAYER_LINE); |
173 } | |
174 else if (type.equals("polygon")) { | |
175 layer.setType(MS_LAYER_TYPE.MS_LAYER_POLYGON); | |
173 } | 176 } |
174 | 177 |
175 //The layer datasource. | 178 //The layer datasource. |
176 layer.setData(layerElement.getAttribute("data_source")); | 179 layer.setData(layerElement.getAttribute("data_source")); |
177 | 180 |
210 exp += " " + classElement.getAttribute("value") + ")"; | 213 exp += " " + classElement.getAttribute("value") + ")"; |
211 } | 214 } |
212 co.setExpression(exp); | 215 co.setExpression(exp); |
213 } | 216 } |
214 //Write symbols and styles. | 217 //Write symbols and styles. |
215 NodeList slist = classElement.getElementsByTagName("symbol"); | 218 NodeList l = classElement.getChildNodes(); |
216 String type = layerElement.getAttribute("type"); | 219 for (int j = 0; j < l.getLength(); j++) { |
217 if(type.equals("point")) { | 220 Element elem = (Element)l.item(j); |
218 for(int j = 0; j < slist.getLength(); j++){ | 221 |
219 Element symbolElement = (Element) slist.item(j); | 222 String type = layerElement.getAttribute("type"); |
223 if(type.equals("point") && elem.getTagName().equals("symbol")) { | |
220 MarkerStyleWriter swriter = new MarkerStyleWriter (this.map, co); | 224 MarkerStyleWriter swriter = new MarkerStyleWriter (this.map, co); |
221 swriter.write (symbolElement); | 225 swriter.write (elem); |
222 } | 226 } |
223 } | 227 else if(type.equals("line") && elem.getTagName().equals("symbol")) { |
224 else if(type.equals("line")) { | |
225 for(int j = 0; j < slist.getLength(); j++){ | |
226 Element symbolElement = (Element) slist.item(j); | |
227 LineStyleWriter swriter = new LineStyleWriter (this.map, co); | 228 LineStyleWriter swriter = new LineStyleWriter (this.map, co); |
228 swriter.write (symbolElement); | 229 swriter.write (elem); |
230 } | |
231 else if(type.equals("polygon") && elem.getTagName().equals("symbol")) { | |
232 FillStyleWriter swriter = new FillStyleWriter (this.map, co); | |
233 swriter.write (elem); | |
229 } | 234 } |
230 } | 235 } |
231 } | 236 } |
232 } | 237 } |
233 } | 238 } |