[Mapbender-commits] r9135 - trunk/mapbender/http/extensions/mapserver
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Thu Dec 18 08:17:45 PST 2014
Author: armin11
Date: 2014-12-18 08:17:45 -0800 (Thu, 18 Dec 2014)
New Revision: 9135
Modified:
trunk/mapbender/http/extensions/mapserver/class_mapserver_layer.php
trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class.php
trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_label.php
trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_style.php
Log:
Enhancement of mapfile generator classes
Modified: trunk/mapbender/http/extensions/mapserver/class_mapserver_layer.php
===================================================================
--- trunk/mapbender/http/extensions/mapserver/class_mapserver_layer.php 2014-12-16 19:31:34 UTC (rev 9134)
+++ trunk/mapbender/http/extensions/mapserver/class_mapserver_layer.php 2014-12-18 16:17:45 UTC (rev 9135)
@@ -12,8 +12,10 @@
public $labelitem;
public $minscaledenom;
public $maxscaledenom;
+ public $labelminscaledenom;
public $labelmaxscaledenom;
public $metadata;
+ public $projection;
public $printElements = array( "name",
"group",
"type",
@@ -25,6 +27,7 @@
"labelitem",
"minscaledenom",
"maxscaledenom",
+ "labelminscaledenom",
"labelmaxscaledenom"
);
@@ -85,6 +88,11 @@
$text .= strtoupper($element)." ".$this->{$element}."\n";
}
}
+ if ($this->projection != null) {
+ $text .= "PROJECTION\n";
+ $text .= " '".$this->projection."'\n";
+ $text .= "END\n";
+ }
if ($this->metadata != null) {
$text .= $this->metadata->printText();
}
Modified: trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class.php
===================================================================
--- trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class.php 2014-12-16 19:31:34 UTC (rev 9134)
+++ trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class.php 2014-12-18 16:17:45 UTC (rev 9135)
@@ -4,9 +4,11 @@
public $name;
public $group;
public $groupname;
+ public $expression;
public $printElements = array( "name",
"group",
- "groupname"
+ "groupname",
+ "expression"
);
private $styles = array();
Modified: trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_label.php
===================================================================
--- trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_label.php 2014-12-16 19:31:34 UTC (rev 9134)
+++ trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_label.php 2014-12-18 16:17:45 UTC (rev 9135)
@@ -10,6 +10,12 @@
public $outlinecolor;
public $position;
public $mindistance;
+ public $angle;
+ public $buffer;
+
+ public $styles = array();
+
+
public $printElements = array( "partials",
"encoding",
"type",
@@ -17,9 +23,56 @@
"size",
"color",
"outlinecolor",
- "mindistance"
+ "position",
+ "mindistance",
+ "angle",
+ "buffer"
);
+ public function addStyle($obj, $key = null) {
+ if ($key == null) {
+ $this->styles[] = $obj;
+ }
+ else {
+ if (isset($this->styles[$key])) {
+ throw new KeyHasUseException("Key $key already in use.");
+ }
+ else {
+ $this->styles[$key] = $obj;
+ }
+ }
+ }
+
+ public function deleteStyle($key) {
+ if (isset($this->styles[$key])) {
+ unset($this->styles[$key]);
+ }
+ else {
+ throw new KeyInvalidException("Invalid key $key.");
+ }
+ }
+
+ public function getStyle($key) {
+ if (isset($this->styles[$key])) {
+ return $this->styles[$key];
+ }
+ else {
+ throw new KeyInvalidException("Invalid key $key.");
+ }
+ }
+
+ public function styleKeys() {
+ return array_keys($this->styles);
+ }
+
+ public function styleKeyExists($key) {
+ return isset($this->styles[$key]);
+ }
+
+
+
+
+
public function printText() {
$printLabel = false;
foreach($this->printElements as $element) {
@@ -35,6 +88,9 @@
$text .= strtoupper($element)." ".$this->{$element}."\n";
}
}
+ foreach ($this->styles as $style) {
+ $text .= $style->printText();
+ }
$text .= "END\n";
}
return $text;
Modified: trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_style.php
===================================================================
--- trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_style.php 2014-12-16 19:31:34 UTC (rev 9134)
+++ trunk/mapbender/http/extensions/mapserver/class_mapserver_layer_class_style.php 2014-12-18 16:17:45 UTC (rev 9135)
@@ -6,11 +6,21 @@
public $size;
public $outlinecolor;
public $width;
+ public $angle;
+ public $pattern;
+ public $geomtransform;
+ public $offset;
+
public $printElements = array( "color",
"symbol",
"size",
"outlinecolor",
- "width"
+ "width",
+ "angle",
+ "pattern",
+ "geomtransform",
+ "offset"
+
);
public function printText() {
More information about the Mapbender_commits
mailing list