comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 205:07b991b940ab

Concatenate grouplayer name and layer name to have a unique identifier for each layer.
author raimund renkert <raimund.renkert@intevation.de>
date Thu, 21 Jul 2011 16:52:36 +0200
parents 52b918f958d0
children 448a2fd085e0
comparison
equal deleted inserted replaced
204:52b918f958d0 205:07b991b940ab
197 map.removeLayer(layer.getIndex()); 197 map.removeLayer(layer.getIndex());
198 continue; 198 continue;
199 } 199 }
200 200
201 //The layer name. 201 //The layer name.
202 String lname = layerElement.getAttribute("name"); 202 String group = "";
203 if(layerElement.hasAttribute("group")) {
204 group = layerElement.getAttribute("group");
205 group = validateString(group);
206 group = group.replaceAll (" ", "");
207 layer.setGroup(group);
208 }
209 String lname = layerElement.getAttribute("name");
203 lname = lname.replaceAll(" ", ""); 210 lname = lname.replaceAll(" ", "");
211 lname = group + "." + lname;
204 layer.setName(validateString(lname)); 212 layer.setName(validateString(lname));
205 layer.setUnits(units.swigValue()); 213 layer.setUnits(units.swigValue());
206 layer.setMetaData("wms_title", validateString(lname)); 214 layer.setMetaData("wms_title", validateString(lname));
207 if(layerElement.hasAttribute("group")) { 215
208 String group = layerElement.getAttribute("group");
209 group = validateString(group);
210 group = group.replaceAll (" ", "");
211 layer.setGroup(group);
212 }
213 216
214 //The layer status. 217 //The layer status.
215 String stat = layerElement.getAttribute("status"); 218 String stat = layerElement.getAttribute("status");
216 if (stat.equals("on")) { 219 if (stat.equals("on")) {
217 layer.setStatus(1); 220 layer.setStatus(1);
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)