[Mapbender-commits] r1820 - branches/mapbender_sld/http/sld/classes
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Nov 15 11:15:33 EST 2007
Author: mschulz
Date: 2007-11-15 11:15:33 -0500 (Thu, 15 Nov 2007)
New Revision: 1820
Modified:
branches/mapbender_sld/http/sld/classes/TextSymbolizer.php
Log:
Label uses new parameterValueType and featureTypes attributes
Modified: branches/mapbender_sld/http/sld/classes/TextSymbolizer.php
===================================================================
--- branches/mapbender_sld/http/sld/classes/TextSymbolizer.php 2007-11-15 16:13:49 UTC (rev 1819)
+++ branches/mapbender_sld/http/sld/classes/TextSymbolizer.php 2007-11-15 16:15:33 UTC (rev 1820)
@@ -10,8 +10,10 @@
/**
* The Label element from the xml-scheme.
* This element is not implemented as an object.
+ * Although it is an object, we'll use a workaround ...
+ * <Label>Townname: <ogc:PropertyValue>NAME</ogc:PropertyValue></Label> should be possible
*
- * @var string
+ * @var object
*/
var $label = "";
@@ -32,7 +34,8 @@
var $labelplacement = "";
//Halo is not supported by Mapserver
- //var $halo = "";
+ var $halo = "";
+
//Fill is not supported by Mapserver - only solid color
var $fill = "";
@@ -50,7 +53,7 @@
function TextSymbolizer()
{
- //$this->font = new Font();
+ //$this->label = new ParameterValue();
//$this->labelplacement = new LabelPlacement();
//$this->fill = new Fill();
}
@@ -64,10 +67,11 @@
function generateXml($offset = "")
{
$temp = $offset."<TextSymbolizer>\n";
- if ($this->label != "") $temp .= $offset." <Label>".htmlspecialchars($this->label)."</Label>\n";
+ #if ($this->label != "") $temp .= $offset." <Label>".htmlspecialchars($this->label)."</Label>\n";
+ if ($this->label != "") $temp .= $offset." <Label>".$this->label->generateXml()."</Label>\n";
if ($this->font != "") $temp .= $this->font->generateXml($offset." ");
if ($this->labelplacement != "") $temp .= $this->labelplacement->generateXml($offset." ");
- //if ($this->halo != "") $temp .= $this->halo->generateXml($offset." ");
+ if ($this->halo != "") $temp .= $this->halo->generateXml($offset." ");
if ($this->fill != "") $temp .= $this->fill->generateXml($offset." ");
$temp .= $offset."</TextSymbolizer>\n";
return $temp;
@@ -86,7 +90,8 @@
function generateHtmlForm($id, $offset= "")
{
$temp = "";
- $temp .= $offset."<table bgcolor=\"#FFFFFF\" border='1' cellspacing='2' cellpadding='0' style=\"border: 1px solid black; width:100%;\">\n";
+ $label_value = "";
+ $temp .= $offset."<table bgcolor=\"#FFFFFF\" cellspacing='2' cellpadding='0' style=\"border: 1px solid black; width:100%;\">\n";
$temp .= $offset." <tr valign=\"top\">\n";
$temp .= $offset." <td class='text' style=\"width: 130px;\">\n";
$temp .= $offset." TextSymbolizer<br>\n";
@@ -106,7 +111,14 @@
$temp .= $offset." Label:\n";
$temp .= $offset." </td>\n";
$temp .= $offset." <td>\n";
- $temp .= $offset." <input name=\"".$id."_label\" value=\"".$this->label."\">\n";
+ $temp .= $offset." <input name=\"".$id."_label\" id=\"".$id."_label\" value=\"";
+ if ($this->label != "")
+ $label_value = $this->label->generateHtmlForm($id."_label","");
+ $temp .= $label_value;
+ $temp .= "\">\n";
+ //experimental
+ $temp_elements = $_SESSION["sld_objects"][3]->generateElementsHtml($id."_label",$label_value);
+ $temp .= $offset.$temp_elements;
$temp .= $offset." </td>\n";
$temp .= $offset." </tr>\n";
$temp .= $offset." </table>\n";
@@ -128,6 +140,15 @@
$temp .= $offset."<a class='edit' href=\"sld_function_handler.php?function=addlabelplacement&id=".$this->id."\">Labelplacement hinzufügen</a><br>\n";
}
//Halo is not supported - removed from source
+ if ($this->halo != "")
+ {
+ $temp .= $this->halo->generateHtmlForm($id."_halo", $offset." ");
+ }
+ else
+ {
+ $temp .= $offset." <a class='edit' href=\"sld_function_handler.php?function=addhalo&id=".$this->id."\">Halo hinzufügen</a><br>\n";
+ }
+
if ($this->fill != "")
{
$temp .= $this->fill->generateHtmlForm($id."_fill", $offset." ");
@@ -157,7 +178,8 @@
{
if (isset($_REQUEST[$id."_label"]))
{
- $this->label = $_REQUEST[$id."_label"];
+ $this->label = new ParameterValue();
+ $this->label->value = $_REQUEST[$id."_label"];
}
if (isset($_REQUEST[$id."_font"]))
{
@@ -169,11 +191,11 @@
$this->labelplacement = new LabelPlacement();
$this->labelplacement->generateObjectFromPost($id."_labelplacement");
}
-// if (isset($_REQUEST[$id."_halo"]))
-// {
-// $this->halo = new Halo();
-// $this->halo->generateObjectFromPost($id."_halo");
-// }
+ if (isset($_REQUEST[$id."_halo"]))
+ {
+ $this->halo = new Halo();
+ $this->halo->generateObjectFromPost($id."_halo");
+ }
if (isset($_REQUEST[$id."_fill"]))
{
$this->fill = new Fill();
@@ -181,4 +203,4 @@
}
}
}
-?>
\ No newline at end of file
+?>
More information about the Mapbender_commits
mailing list