comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 304:50031b1ae8e6

No longer ignore Layers without classes
author Andre Heinecke <aheinecke@intevation.de>
date Wed, 05 Sep 2012 17:18:18 +0200
parents 215ae6199b95
children ebf974199309
comparison
equal deleted inserted replaced
303:a9684178cb29 304:50031b1ae8e6
259 NodeList list = mapNode.getElementsByTagName("layer"); 259 NodeList list = mapNode.getElementsByTagName("layer");
260 for(int i = 0; i < list.getLength(); i++) { 260 for(int i = 0; i < list.getLength(); i++) {
261 Element layerElement = (Element)list.item(i); 261 Element layerElement = (Element)list.item(i);
262 layerObj layer = new layerObj(map); 262 layerObj layer = new layerObj(map);
263 NodeList renderer = layerElement.getElementsByTagName("renderer"); 263 NodeList renderer = layerElement.getElementsByTagName("renderer");
264 if (renderer.getLength() == 0 &&
265 layerElement.getAttribute("connection_type") != "WMS") {
266 map.removeLayer(layer.getIndex());
267 logger.warn(
268 "Skipping empty layer " +
269 layerElement.getAttribute("name"));
270 continue;
271 }
272 264
273 //The layer name. 265 //The layer name.
274 String group = ""; 266 String group = "";
275 if(layerElement.hasAttribute("group")) { 267 if(layerElement.hasAttribute("group")) {
276 group = layerElement.getAttribute("group"); 268 group = layerElement.getAttribute("group");
396 } 388 }
397 389
398 //The layer datasource. 390 //The layer datasource.
399 String con_type = layerElement.getAttribute("connection_type"); 391 String con_type = layerElement.getAttribute("connection_type");
400 if(con_type.equals("local")) { 392 if(con_type.equals("local")) {
401 // The data source is a local file. (.shp) 393 // The data source is a local file. (.shp or Image)
402 String datasource = ""; 394 String datasource = "";
403 if(layerElement.hasAttribute("workspace")) { 395 if(layerElement.hasAttribute("workspace")) {
404 datasource = layerElement.getAttribute("workspace"); 396 datasource = layerElement.getAttribute("workspace");
405 datasource += File.separator; 397 datasource += File.separator;
406 } 398 }
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)