comparison src/java/de/intevation/mxd/writer/MapScriptWriter.java @ 321:b6c0fbae16dc

Expand Graphics Layer Support
author Andre Heinecke <aheinecke@intevation.de>
date Thu, 20 Sep 2012 17:58:29 +0200
parents 9289b7c1b4ce
children 40442cbfbcc7
comparison
equal deleted inserted replaced
320:9289b7c1b4ce 321:b6c0fbae16dc
549 // Set Offsite value for raster layer 549 // Set Offsite value for raster layer
550 if(type == "raster") { 550 if(type == "raster") {
551 layer.setOffsite(new colorObj(255,255,255,-4)); 551 layer.setOffsite(new colorObj(255,255,255,-4));
552 } 552 }
553 553
554 // Set scaling properties for layer 554 // Set scaling properties for layer and add Processing
555 if(type == "annotation") { 555 if(type == "annotation") {
556 if (mapNode.hasAttribute("referencescale")) { 556 if (mapNode.hasAttribute("referencescale")) {
557 layer.setSymbolscaledenom(Double.parseDouble( 557 layer.setSymbolscaledenom(Double.parseDouble(
558 mapNode.getAttribute("referencescale"))); 558 mapNode.getAttribute("referencescale")));
559 } 559 }
560 layer.addProcessing("ITEMS=classId");
561 layer.setClassitem("classId");
560 } 562 }
561 563
562 // Create labelitem 564 // Create labelitem
563 NodeList labels = layerElement.getElementsByTagName("label"); 565 NodeList labels = layerElement.getElementsByTagName("label");
564 if(labels.getLength() > 0) { 566 if(labels.getLength() > 0) {
614 616
615 shapeObj shape = new shapeObj(MS_SHAPE_TYPE.MS_SHAPE_POINT.swigValue()); 617 shapeObj shape = new shapeObj(MS_SHAPE_TYPE.MS_SHAPE_POINT.swigValue());
616 shape.add(line); 618 shape.add(line);
617 shape.setText(feature.getAttribute("text")); 619 shape.setText(feature.getAttribute("text"));
618 620
619 // Write the Style / Symbol once 621 shape.initValues(1);
620 if ( i == 0 ) { 622 shape.setValue(0, feature.getAttribute("classId"));
621 classObj co = new classObj(layer); 623
622 writeLabel(co, feature, layerElement.getAttribute("type")); 624 // Write the Style / Symbol for each element as a single class
623 LabelStyleWriter swriter = new LabelStyleWriter (this.map, co); 625 // TODO build a hash of the style/symbol and check if classes can be
624 swriter.write((Element)feature.getFirstChild()); 626 // grouped
625 } 627
628 classObj co = new classObj(layer);
629 writeLabel(co, feature, layerElement.getAttribute("type"));
630 co.setExpression("\"" + feature.getAttribute("classId") + "\"");
631 LabelStyleWriter swriter = new LabelStyleWriter (this.map, co);
632 swriter.write((Element)feature.getFirstChild());
626 layer.addFeature(shape); 633 layer.addFeature(shape);
627 } 634 }
628 } 635 }
629 636
630 /** 637 /**
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)