[Mapbender-commits] r3137 - in branches/nimix_dev: . conf core
http/classes http/html http/javascripts http/php http/print
http/tools owsproxy/http
svn_mapbender at osgeo.org
svn_mapbender at osgeo.org
Tue Oct 7 04:15:38 EDT 2008
Author: nimix
Date: 2008-10-07 04:15:38 -0400 (Tue, 07 Oct 2008)
New Revision: 3137
Added:
branches/nimix_dev/http/php/mod_showGuiName.php
Removed:
branches/nimix_dev/http/javascripts/wfs_usemap.js
Modified:
branches/nimix_dev/conf/wfs_additional_spatial_search.conf
branches/nimix_dev/conf/wfs_default.conf
branches/nimix_dev/core/globalSettings.php
branches/nimix_dev/http/classes/class_bbox.php
branches/nimix_dev/http/classes/class_kml_line.php
branches/nimix_dev/http/classes/class_kml_linearring.php
branches/nimix_dev/http/classes/class_kml_ows.php
branches/nimix_dev/http/classes/class_kml_parser_ows.php
branches/nimix_dev/http/classes/class_kml_placemark.php
branches/nimix_dev/http/classes/class_kml_point.php
branches/nimix_dev/http/classes/class_locale.php
branches/nimix_dev/http/classes/class_point.php
branches/nimix_dev/http/classes/class_wfs.php
branches/nimix_dev/http/classes/class_wfs_conf.php
branches/nimix_dev/http/html/mod_treefolder2.php
branches/nimix_dev/http/javascripts/geometry.js
branches/nimix_dev/http/javascripts/map.js
branches/nimix_dev/http/javascripts/map.php
branches/nimix_dev/http/javascripts/mod_highlightPOI.php
branches/nimix_dev/http/javascripts/mod_savewmc.php
branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php
branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php
branches/nimix_dev/http/javascripts/wfs.js
branches/nimix_dev/http/php/mod_forgottenPassword.php
branches/nimix_dev/http/php/mod_meetingPoint.php
branches/nimix_dev/http/print/mod_printPDF_pdf.php
branches/nimix_dev/http/tools/mod_monitorCapabilities_read.php
branches/nimix_dev/last_merged.txt
branches/nimix_dev/owsproxy/http/index.php
Log:
merge with trunk
Modified: branches/nimix_dev/conf/wfs_additional_spatial_search.conf
===================================================================
--- branches/nimix_dev/conf/wfs_additional_spatial_search.conf 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/conf/wfs_additional_spatial_search.conf 2008-10-07 08:15:38 UTC (rev 3137)
@@ -12,6 +12,8 @@
var buttonPoint = {"status":1, "img":"select_point_off.png","title":"Punktauswahl"};
var buttonExtent = {"status":1,"img":"select_extent_off.png","title":"Auswahl Kartenrahmen"};
+var mb_wfs_tolerance = 8;
+
var spatialRequestIsSetMessage = "Gebiet eingegrenzt, bitte OK klicken!";
var clearFilterButtonLabel = "Neu";
Modified: branches/nimix_dev/conf/wfs_default.conf
===================================================================
--- branches/nimix_dev/conf/wfs_default.conf 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/conf/wfs_default.conf 2008-10-07 08:15:38 UTC (rev 3137)
@@ -14,6 +14,8 @@
var buttonExtent = {"status":1, "x":840, "y":10, "img":"select_extent_off.png"};
var buttonDialogue = {"status":1, "x":870, "y":10, "img":"select_choose_off.png"};
+var mb_wfs_tolerance = 8;
+
var buttonWfs_imgdir = "../img/button_gray/";
var buttonWfs_zIndex = 10;
Modified: branches/nimix_dev/core/globalSettings.php
===================================================================
--- branches/nimix_dev/core/globalSettings.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/core/globalSettings.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -66,4 +66,8 @@
$con = db_connect($DBSERVER, $OWNER, $PW);
db_select_db(DB, $con);
+//
+// Do not display PHP errors
+//
+ini_set("display_errors", "0");
?>
Modified: branches/nimix_dev/http/classes/class_bbox.php
===================================================================
--- branches/nimix_dev/http/classes/class_bbox.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_bbox.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -18,6 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+require_once(dirname(__FILE__)."/class_point.php");
/**
* A bounding box consisting of an lower left and an upper right point, and an EPSG.
Modified: branches/nimix_dev/http/classes/class_kml_line.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_line.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_line.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -44,34 +44,32 @@
#
if (preg_match("/,/", $pointArray[$i])) {
$aPoint = explode(",", $pointArray[$i]);
- # ignore altitude
// KML only supperts EPSG 4326, so
// the coordinates are transformed
- $pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+ $pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
if (isset($epsg) && $epsg != 4326) {
$pt->transform(4326);
}
- $point = array("x" => $pt->x, "y" => $pt->y);
+ $point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
array_push($this->pointArray, $point);
}
}
}
else {
$pointArray = explode(" ", $geometryString);
- for ($i=0; $i < count($pointArray); $i+=2) {
+ for ($i=0; $i < count($pointArray); $i+=3) {
#
# Some KMLs have a lot of whitespaces; this "if" is an
# ugly hack to prevent adding empty points
#
if ($pointArray[$i] && $pointArray[$i+1]) {
- # ignore altitude
- $pt = new Mapbender_point($pointArray[$i], $pointArray[$i+1], $epsg);
+ $pt = new Mapbender_point($pointArray[$i], $pointArray[$i+1], $pointArray[$i+2], $epsg);
// KML only supperts EPSG 4326, so
// the coordinates are transformed
if (isset($epsg) && $epsg != 4326) {
$pt->transform(4326);
}
- $point = array("x" => $pt->x, "y" => $pt->y);
+ $point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
array_push($this->pointArray, $point);
}
}
@@ -96,7 +94,12 @@
if ($i > 0) {
$str .= ",";
}
- $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+ if ($this->pointArray[$i]["z"]) {
+ $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"].",".$this->pointArray[$i]["z"]."]";
+ }
+ else {
+ $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+ }
}
return "{\"type\": \"LineString\", \"coordinates\":[" . $str . "]}";
}
@@ -106,7 +109,7 @@
}
/**
- * @return array an array of points as associative array, coordinates as ["x"] and ["y"]
+ * @return array an array of points as associative array, coordinates as ["x"] and ["y"] and ["z"]
*/
public function getPointArray () {
return $this->pointArray;
@@ -114,7 +117,7 @@
/**
* An array of points, with a point being an associative
- * array consisting of attributes "x" and "y".
+ * array consisting of attributes "x" and "y" and "z"
*/
protected $pointArray = array();
}
Modified: branches/nimix_dev/http/classes/class_kml_linearring.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_linearring.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_linearring.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -42,7 +42,12 @@
if ($i > 0) {
$str .= ",";
}
- $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+ if ($this->pointArray[$i]["z"]) {
+ $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"].",".$this->pointArray[$i]["z"]."]";
+ }
+ else {
+ $str .= "[".$this->pointArray[$i]["x"].",".$this->pointArray[$i]["y"]."]";
+ }
}
return "[" . $str . "]";
}
Modified: branches/nimix_dev/http/classes/class_kml_ows.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_ows.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_ows.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -45,6 +45,114 @@
public function __construct() {
}
+ public function toSingleLineStringKml() {
+ //KML 2.2 output
+ $doc = new DOMDocument("1.0", CHARSET);
+ $doc->preserveWhiteSpace = false;
+
+ // attach kml and Document tag
+ $e_kml = $doc->createElementNS("http://earth.google.com/kml/2.2", "kml");
+ $e_document = $doc->createElement("Document");
+ $e_kml->appendChild($e_document);
+ $doc->appendChild($e_kml);
+
+ // attach placemarks
+ $e = new mb_notice("to string: #placemarks: " . count($this->placemarkArray));
+
+ $lineStyleNode = $doc->createElement("Style");
+ $lineStyleNode->setAttribute("id", "linestyleExample");
+ $lineStyleColorNode = $doc->createElement("color", "7f0000ff");
+ $lineStyleWidthNode = $doc->createElement("width", 4);
+ $lineStyleNode->appendChild($lineStyleColorNode);
+ $lineStyleNode->appendChild($lineStyleWidthNode);
+ $e_document->appendChild($lineStyleNode);
+
+ //
+ // line segments first
+ //
+ $coordinates = "";
+
+ for ($i = 0; $i < count($this->placemarkArray); $i++) {
+ $currentPlacemark = $this->placemarkArray[$i];
+ $e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
+
+ switch ($currentPlacemark->getGeometryType()) {
+ case "KMLLine" :
+ $coordinatesArray = $currentPlacemark->getGeometry()->getPointArray();
+ for ($j = 0; $j < count($coordinatesArray); $j++) {
+ if (!($j == 0 && $i == 0)) {
+ $coordinates .= " ";
+ }
+ $coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
+
+ }
+ break;
+ }
+ }
+ // create a placemark tag with a geometry and add it to the document
+ $e_coordinates = $doc->createElement("coordinates", $coordinates);
+ $e_geometry = $doc->createElement("LineString");
+ $e_geometry->appendChild($e_coordinates);
+ $e_placemark = $doc->createElement("Placemark");
+ $e_placemark->appendChild($e_geometry);
+ $e_pl_name = $doc->createElement("name", "Route");
+ $e_placemark->appendChild($e_pl_name);
+ $e_pl_style = $doc->createElement("styleUrl", "#linestyleExample");
+ $e_placemark->appendChild($e_pl_style);
+ $e_document->appendChild($e_placemark);
+
+/*
+ //
+ // now pois
+ //
+ // attach placemarks
+ $e = new mb_notice("to string: #placemarks: " . count($this->placemarkArray));
+ for ($i = 0; $i < count($this->placemarkArray); $i++) {
+ $currentPlacemark = $this->placemarkArray[$i];
+
+ $e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
+
+ $pl_instructions = $currentPlacemark->getProperty("instruction");
+ $pl_name_array = array();
+ $pl_name = false;
+ $pl_description = false;
+ if ($pl_instructions != null) {
+ $pl_name_array = explode("|", $pl_instructions);
+ }
+
+ switch ($currentPlacemark->getGeometryType()) {
+ case "KMLPoint" :
+ if (count($pl_name_array) > 2) {
+ $pl_name = $pl_name_array[0];
+ $pl_description = $pl_name_array[1];
+ }
+ $e_geometry = $doc->createElement("Point");
+ $point = $currentPlacemark->getGeometry()->getPoint();
+ $coordinates = $point["x"] . "," . $point["y"];
+ $e_coordinates = $doc->createElement("coordinates", $coordinates);
+ $e_geometry->appendChild($e_coordinates);
+ break;
+
+ }
+ // create a placemark tag with a geometry and add it to the document
+ if ($e_geometry) {
+ $e_placemark = $doc->createElement("Placemark");
+ $e_placemark->appendChild($e_geometry);
+ if ($pl_name) {
+ $e_pl_name = $doc->createElement("name", $pl_name);
+ $e_placemark->appendChild($e_pl_name);
+ }
+ if ($pl_description) {
+ $e_pl_description = $doc->createElement("description", $pl_description);
+ $e_placemark->appendChild($e_pl_description);
+ }
+ $e_document->appendChild($e_placemark);
+ }
+ }
+*/
+ return $doc->saveXML();
+ }
+
/**
* @return string the KML document.
*/
@@ -69,9 +177,20 @@
$e = new mb_notice("now: " . $i . " of " . (count($this->placemarkArray)-1) . " (is a " . get_class($currentPlacemark) . ")");
+ $pl_instructions = $currentPlacemark->getProperty("instruction");
+ $pl_name_array = array();
+ $pl_name = false;
+ $pl_description = false;
+ if ($pl_instructions != null) {
+ $pl_name_array = explode("|", $pl_instructions);
+ }
switch ($currentPlacemark->getGeometryType()) {
case "KMLPoint" :
+ if (count($pl_name_array) > 2) {
+ $pl_name = $pl_name_array[0];
+ $pl_description = $pl_name_array[1];
+ }
$e_geometry = $doc->createElement("Point");
$point = $currentPlacemark->getGeometry()->getPoint();
$coordinates = $point["x"] . "," . $point["y"];
@@ -100,6 +219,9 @@
break;
*/
case "KMLLine" :
+ if (count($pl_name_array) > 2) {
+ $pl_description = $pl_name_array[1];
+ }
$e_geometry = $doc->createElement("LineString");
$coordinatesArray = $currentPlacemark->getGeometry()->getPointArray();
$coordinates = "";
@@ -107,7 +229,7 @@
if ($j > 0) {
$coordinates .= " ";
}
- $coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . ",0";
+ $coordinates .= $coordinatesArray[$j]["x"] . "," . $coordinatesArray[$j]["y"] . "," . $coordinatesArray[$j]["z"];
}
$e_coordinates = $doc->createElement("coordinates", $coordinates);
@@ -123,6 +245,14 @@
if ($e_geometry) {
$e_placemark = $doc->createElement("Placemark");
$e_placemark->appendChild($e_geometry);
+ if ($pl_name) {
+ $e_pl_name = $doc->createElement("name", $pl_name);
+ $e_placemark->appendChild($e_pl_name);
+ }
+ if ($pl_description) {
+ $e_pl_description = $doc->createElement("description", $pl_description);
+ $e_placemark->appendChild($e_pl_description);
+ }
$e_document->appendChild($e_placemark);
}
}
@@ -300,23 +430,29 @@
* @return boolean true, if the KML could be stored in the database; else false.
*/
private function storeInDb () {
- $con = db_connect(DBSERVER,OWNER,PW);
- db_select_db(DB,$con);
-
- $sql = "INSERT INTO gui_kml ";
- $sql .= "(fkey_mb_user_id, fkey_gui_id, kml_doc, kml_name, kml_description, kml_timestamp) ";
- $sql .= "VALUES ";
- $sql .= "($1, $2, $3, $4, $5, $6)";
- $v = array ($_SESSION["mb_user_id"], $_SESSION["mb_user_gui"], $this->kml, "name", "description", time());
- $t = array ("i", "s", "s", "s", "s", "s");
- $res = db_prep_query($sql, $v, $t);
- if (!$res) {
- $e = new mb_exception("class_kml.php: storeInDb: failed to store KML in database: " . db_error());
- return false;
+ if ($_SESSION["mb_user_id"] && $_SESSION["mb_user_gui"]) {
+ $con = db_connect(DBSERVER,OWNER,PW);
+ db_select_db(DB,$con);
+
+ $sql = "INSERT INTO gui_kml ";
+ $sql .= "(fkey_mb_user_id, fkey_gui_id, kml_doc, kml_name, kml_description, kml_timestamp) ";
+ $sql .= "VALUES ";
+ $sql .= "($1, $2, $3, $4, $5, $6)";
+ $v = array ($_SESSION["mb_user_id"], $_SESSION["mb_user_gui"], $this->kml, "name", "description", time());
+ $t = array ("i", "s", "s", "s", "s", "s");
+ $res = db_prep_query($sql, $v, $t);
+ if (!$res) {
+ $e = new mb_exception("class_kml.php: storeInDb: failed to store KML in database: " . db_error());
+ return false;
+ }
+
+ $this->id = db_insert_id($con, "gui_kml", "kml_id");
+ return true;
}
-
- $this->id = db_insert_id($con, "gui_kml", "kml_id");
- return true;
+ else {
+ // should be false, but code in caller has to be changed first.
+ return true;
+ }
}
/**
Modified: branches/nimix_dev/http/classes/class_kml_parser_ows.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_parser_ows.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_parser_ows.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -44,6 +44,9 @@
$id = 0;
if (gettype($geometryFromGeoJSON) == "object" && $geometryFromGeoJSON->type == "FeatureCollection") {
+ if ($geometryFromGeoJSON->crs->type == "EPSG" && $geometryFromGeoJSON->crs->properties->code) {
+ $epsg = $geometryFromGeoJSON->crs->properties->code;
+ }
// create Placemarks
for ($i = 0; $i < count($geometryFromGeoJSON->features); $i++) {
$e = new mb_notice("parsing plm #" . $i . "...length of placemarkArray: " . count($this->placemarkArray));
@@ -52,7 +55,9 @@
if ($feature->geometry->crs->type == "EPSG") {
$epsg = $feature->geometry->crs->properties->code;
}
- $e = new mb_notice("EPSG: " . $epsg);
+ if (!$epsg) {
+ $e = new mb_notice("EPSG is not set! Aborting...(" . $epsg . ")");
+ }
$geometry = $feature->geometry;
$currentGeometry = false;
Modified: branches/nimix_dev/http/classes/class_kml_placemark.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_placemark.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_placemark.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -54,7 +54,7 @@
* @return mixed the property value; if none exists, null.
*/
public function getProperty ($key) {
- if (array_key_exists($key)) {
+ if (array_key_exists($key, $this->properties)) {
return $this->properties[$key];
}
$e = new mb_exception("class_kml_placemark.php: getProperty: no value for key '" . $key . "'");
Modified: branches/nimix_dev/http/classes/class_kml_point.php
===================================================================
--- branches/nimix_dev/http/classes/class_kml_point.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_kml_point.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -41,12 +41,12 @@
if (preg_match("/,/", $geometryString)) {
$aPoint = explode(",", $geometryString);
// ignore altitude
- $pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+ $pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
}
else {
$aPoint = explode(" ", $geometryString);
// ignore altitude
- $pt = new Mapbender_point($aPoint[0], $aPoint[1], $epsg);
+ $pt = new Mapbender_point($aPoint[0], $aPoint[1], $aPoint[2], $epsg);
}
// KML only supperts EPSG 4326, so
@@ -54,7 +54,7 @@
if (isset($epsg) && $epsg != 4326) {
$pt->transform(4326);
}
- $this->point = array("x" => $pt->x, "y" => $pt->y);
+ $this->point = array("x" => $pt->x, "y" => $pt->y, "z" => $pt->z);
}
/**
@@ -69,7 +69,12 @@
*/
public function toGeoJSON () {
if ($this->point !== null) {
- return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"]."]}";
+ if ($this->point["z"]) {
+ return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"].",".$this->point["z"]."]}";
+ }
+ else {
+ return "{\"type\": \"Point\", \"coordinates\": [".$this->point["x"].",".$this->point["y"]."]}";
+ }
}
$e = new mb_exception("KMLPoint: toGeoJSON: this point is null.");
@@ -77,14 +82,14 @@
}
/**
- * @return array a point as associative array, coordinates as ["x"] and ["y"]
+ * @return array a point as associative array, coordinates as ["x"] and ["y"] and ["z"]
*/
public function getPoint () {
return $this->point;
}
/**
- * @var float[] an associative array, with "x", and "y" being float values.
+ * @var float[] an associative array, with "x", and "y" and "z" being float values.
*/
private $point;
}
Modified: branches/nimix_dev/http/classes/class_locale.php
===================================================================
--- branches/nimix_dev/http/classes/class_locale.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_locale.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -1,216 +1,218 @@
-<?php
-# $Id$
-# http://www.mapbender.org/index.php/class_locale.php
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
-
-require_once(dirname(__FILE__)."/../../core/globalSettings.php");
-
-/**
- * sets the locale, depending on various settings:
- * 1) a language ID passed to the constructor
- * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
- * 3) a default language ID
- *
- */
-class Mb_locale {
- var $knownLanguages = null;
- var $systemLocales = null;
- var $browserLanguages = null;
- var $os = null;
- var $name = null;
- var $defaultLanguage = "en";
- var $status = "No locale set.";
-
- function Mb_locale($languageId) {
- if (!$languageId) {
- $languageId = LANGUAGE;
- }
- $e = new Mb_notice("class_locale: setting locale to " . $languageId);
- if (USE_I18N) {
- if (!$this->setCurrentLocale($languageId)) {
- $e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
- }
- }
- else {
- $this->setCurrentLocale($this->defaultLanguage);
- }
- }
-
- /**
- * Get the current locale, evaluating GET/POST variables, browser languages
- * and a default locale (in that preference)
- *
- * @returns current locale
- */
- function setCurrentLocale($languageId) {
-
- // try to set the locale to $languageId
- if ($this->checkAndSetLocale($languageId)) {
- return true;
- }
- else {
- $e = new Mb_notice("class_locale: no input parameter specified.");
- }
-
- // determine the browser setting and try to set locale according to that
- if ($this->browserLanguage == null) {
- $this->setBrowserLanguages();
- }
- foreach ($this->browserLanguages as $lang) {
- $e = new Mb_notice("trying browser setting " . $lang);
- if ($this->checkAndSetLocale($lang)) {
- return true;
- }
- }
-
- // set to default language
- $e = new Mb_notice("trying default language " . $this->defaultLanguage);
- return $this->checkAndSetLocale($this->defaultLanguage);
- }
-
- /**
- * checks if a locale is available; if yes, it is set via setlocale
- *
- * @returns true if the the locale is set successfully; otherwise false
- */
- function checkAndSetLocale($languageId) {
- if ($this->os == null) {
- $this->os = $this->guessHostOS();
- }
-
- if (!USE_I18N || ($this->os != null && isset($languageId))) {
- if ($this->isKnownLanguage($languageId)) {
-
- if ($this->systemLocales == null) {
- $this->setSystemLocales();
- }
-
- $locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];
- $selectedLocale = setlocale(LC_MESSAGES, $locale);
- if ($selectedLocale) {
- $this->name = $selectedLocale;
- $_SESSION["mb_lang"] = $languageId;
- $_SESSION["mb_locale"] = $this->name;
- $e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
- // from http://de3.php.net/manual/de/function.gettext.php
- $path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
- $enc = bind_textdomain_codeset("Mapbender", "UTF-8");
- $dom = textdomain("Mapbender");
- return true;
- }
- }
- }
- $e = new Mb_notice("locale " . $locale . " not found.");
- return false;
- }
-
- /**
- * Guess the operating system which on which this code is running
- * multiple methods are tested for reliably guessing the os
- *
- * @private
- * @returns string with os name
- */
- function guessHostOS(){
- if (strncasecmp(php_uname(), 'Windows', 7) == 0)
- return 'windows';
- else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
- return 'linux';
- else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
- return 'bsd';
- else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
- return 'bsd';
- else {
- $e = new mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
- return null;
- }
- }
-
- /**
- * checks if a language is supported
- *
- * @returns true if the language is supported; otherwise false
- */
- function isKnownLanguage($languageId) {
- if ($this->knownLocales == null) {
- $this->setKnownLanguages();
- }
- if (array_key_exists($languageId, $this->knownLanguages)) {
- return true;
- }
- else {
- $e = new Mb_notice("language " . $languageId . " not supported.");
- }
- return false;
- }
-
-
-
- /**
- * determines the available Locales on this system
- */
- function setSystemLocales() {
- $this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
- 'windows' => 'Italian_Italy.1252',
- 'bsd' => 'it_IT',
- 'posix' => 'it_IT');
- $this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
- 'windows' => 'German_Germany.1252',
- 'bsd' => 'de_DE',
- 'posix' => 'it_IT');
- $this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
- 'windows' => 'English_United States.1252',
- 'bsd' => 'en_US',
- 'posix' => 'it_IT');
- }
-
- /**
- * set the known languages
- */
- function setKnownLanguages() {
- $this->knownLanguages = array('en_US' => 'en_US',
- 'en' => 'en_US',
- 'de_DE' => 'de_DE',
- 'de' => 'de_DE',
- 'bg_BG' => 'bg_BG',
- 'bg' => 'bg_BG',
- 'es_ES' => 'es_ES',
- 'es' => 'es_ES',
- 'nl_NL' => 'nl_NL',
- 'nl' => 'nl_NL',
- 'gr_GR' => 'gr_GR',
- 'gr' => 'gr_GR',
- 'it_IT' => 'it_IT',
- 'it' => 'it_IT');
- }
-
- /**
- * sets the languages accepted by the client browser
- */
- function setBrowserLanguages () {
- $this->browserLanguages = array();
-
- $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
- foreach ($bLangs as $lang) {
- if (strpos($lang, ';') === false)
- array_push($this->browserLanguages, $lang);
- else
- array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
- }
- }
-}
-?>
+<?php
+# $Id$
+# http://www.mapbender.org/index.php/class_locale.php
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
+
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
+
+/**
+ * sets the locale, depending on various settings:
+ * 1) a language ID passed to the constructor
+ * 2) the browser settings $_SERVER["HTTP_ACCEPT_LANGUAGE"]
+ * 3) a default language ID
+ *
+ */
+class Mb_locale {
+ var $knownLanguages = null;
+ var $systemLocales = null;
+ var $browserLanguages = null;
+ var $os = null;
+ var $name = null;
+ var $defaultLanguage = "en";
+ var $status = "No locale set.";
+
+ function Mb_locale($languageId) {
+ if (!$languageId) {
+ $languageId = LANGUAGE;
+ }
+ $e = new Mb_notice("class_locale: setting locale to " . $languageId);
+ if (USE_I18N) {
+ if (!$this->setCurrentLocale($languageId)) {
+ $e = new Mb_exception("Locale could not be set. Language ID: '" . $languageId . "'");
+ }
+ }
+ else {
+ $this->setCurrentLocale($this->defaultLanguage);
+ }
+ }
+
+ /**
+ * Get the current locale, evaluating GET/POST variables, browser languages
+ * and a default locale (in that preference)
+ *
+ * @returns current locale
+ */
+ function setCurrentLocale($languageId) {
+
+ // try to set the locale to $languageId
+ if ($this->checkAndSetLocale($languageId)) {
+ return true;
+ }
+ else {
+ $e = new Mb_notice("class_locale: no input parameter specified.");
+ }
+
+ // determine the browser setting and try to set locale according to that
+ if ($this->browserLanguage == null) {
+ $this->setBrowserLanguages();
+ }
+ foreach ($this->browserLanguages as $lang) {
+ $e = new Mb_notice("trying browser setting " . $lang);
+ if ($this->checkAndSetLocale($lang)) {
+ return true;
+ }
+ }
+
+ // set to default language
+ $e = new Mb_notice("trying default language " . $this->defaultLanguage);
+ return $this->checkAndSetLocale($this->defaultLanguage);
+ }
+
+ /**
+ * checks if a locale is available; if yes, it is set via setlocale
+ *
+ * @returns true if the the locale is set successfully; otherwise false
+ */
+ function checkAndSetLocale($languageId) {
+ if ($this->os == null) {
+ $this->os = $this->guessHostOS();
+ }
+
+ if (!USE_I18N || ($this->os != null && isset($languageId))) {
+ if ($this->isKnownLanguage($languageId)) {
+
+ if ($this->systemLocales == null) {
+ $this->setSystemLocales();
+ }
+
+ $locale = $this->systemLocales[$this->knownLanguages[$languageId]][$this->os];
+ $selectedLocale = setlocale(LC_MESSAGES, $locale);
+ if ($selectedLocale) {
+ $this->name = $selectedLocale;
+ $_SESSION["mb_lang"] = $languageId;
+ $_SESSION["mb_locale"] = $this->name;
+ $e = new Mb_notice("locale " . $this->name . " ok on " . $this->os);
+ // from http://de3.php.net/manual/de/function.gettext.php
+ $path = bindtextdomain("Mapbender", dirname(__FILE__)."/../../resources/locale/");
+ $enc = bind_textdomain_codeset("Mapbender", "UTF-8");
+ $dom = textdomain("Mapbender");
+ return true;
+ }
+ }
+ }
+ $e = new Mb_notice("locale " . $locale . " not found.");
+ return false;
+ }
+
+ /**
+ * Guess the operating system which on which this code is running
+ * multiple methods are tested for reliably guessing the os
+ *
+ * @private
+ * @returns string with os name
+ */
+ function guessHostOS(){
+ if (strncasecmp(php_uname(), 'Windows', 7) == 0)
+ return 'windows';
+ else if (strncasecmp(php_uname(), 'Linux', 5) == 0)
+ return 'linux';
+ else if (strncasecmp(php_uname(), 'OpenBSD', 7) == 0)
+ return 'bsd';
+ else if (strncasecmp(php_uname(), 'FreeBSD', 7) == 0)
+ return 'bsd';
+ else {
+ throw new Mb_exception('unknown platform: could not interpret uname. php_uname() returned '. php_uname().'. Please report to MB developers');
+ return null;
+ }
+ }
+
+ /**
+ * checks if a language is supported
+ *
+ * @returns true if the language is supported; otherwise false
+ */
+ function isKnownLanguage($languageId) {
+ if ($this->knownLocales == null) {
+ $this->setKnownLanguages();
+ }
+ if (array_key_exists($languageId, $this->knownLanguages)) {
+ return true;
+ }
+ else {
+ $e = new Mb_notice("language " . $languageId . " not supported.");
+ }
+ return false;
+ }
+
+
+
+ /**
+ * determines the available Locales on this system
+ */
+ function setSystemLocales() {
+ $this->systemLocales['it_IT'] = array('linux' => 'it_IT.utf8',
+ 'windows' => 'Italian_Italy.1252',
+ 'bsd' => 'it_IT',
+ 'posix' => 'it_IT');
+ $this->systemLocales['de_DE'] = array('linux' => 'de_DE.utf8',
+ 'windows' => 'German_Germany.1252',
+ 'bsd' => 'de_DE',
+ 'posix' => 'de_DE');
+ $this->systemLocales['en_US'] = array('linux' => 'en_US.utf8',
+ 'windows' => 'English_United States.1252',
+ 'bsd' => 'en_US',
+ 'posix' => 'en_US');
+ }
+
+ /**
+ * set the known languages
+ */
+ function setKnownLanguages() {
+ $this->knownLanguages = array('en_US' => 'en_US',
+ 'en' => 'en_US',
+ 'de_DE' => 'de_DE',
+ 'de' => 'de_DE',
+ 'bg_BG' => 'bg_BG',
+ 'bg' => 'bg_BG',
+ 'es_ES' => 'es_ES',
+ 'es' => 'es_ES',
+ 'nl_NL' => 'nl_NL',
+ 'nl' => 'nl_NL',
+ 'fr_FR' => 'fr_FR',
+ 'fr' => 'fr_FR',
+ 'gr_GR' => 'gr_GR',
+ 'gr' => 'gr_GR',
+ 'it_IT' => 'it_IT',
+ 'it' => 'it_IT');
+ }
+
+ /**
+ * sets the languages accepted by the client browser
+ */
+ function setBrowserLanguages () {
+ $this->browserLanguages = array();
+
+ $bLangs = split(',', $_SERVER["HTTP_ACCEPT_LANGUAGE"]);
+ foreach ($bLangs as $lang) {
+ if (strpos($lang, ';') === false)
+ array_push($this->browserLanguages, $lang);
+ else
+ array_push($this->browserLanguages, substr($lang, 0, strpos($lang, ';')));
+ }
+ }
+}
+?>
\ No newline at end of file
Modified: branches/nimix_dev/http/classes/class_point.php
===================================================================
--- branches/nimix_dev/http/classes/class_point.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_point.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -20,22 +20,30 @@
require_once(dirname(__FILE__)."/../../core/globalSettings.php");
/**
- * A Mapbender_point is a 2-dimensional point with an EPSG.
+ * A Mapbender_point is a 2- or 3-dimensional point with an EPSG.
*/
class Mapbender_point {
var $x;
var $y;
+ var $z;
var $epsg;
/**
* @constructor
*/
- function __construct($x, $y, $epsg) {
- if (!$x || !$y || !$epsg) {
- $e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", epsg:".$epsg.")!");
+ function __construct($x, $y, $z, $epsg) {
+ // may be called without $z; so $epsg is the third parameter, $z
+ if (isset($x) && isset($y) && isset($z) && !isset($epsg)) {
+ $e = new mb_notice("Mapbender_point: constructor: probably 2d call (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
+ $epsg = $z;
+ $z = false;
}
+ if (!isset($x) || !isset($y) || !isset($epsg)) {
+ $e = new mb_exception("Mapbender_point: constructor: some parameters are not set (set (x: ".$x.", y: ".$y.", z: ".$z.", epsg:".$epsg.")!");
+ }
$this->x = $x;
$this->y = $y;
+ $this->z = $z;
$this->epsg = $epsg;
}
@@ -136,11 +144,20 @@
$currentEpsg = preg_replace("/EPSG:/", "", $this->epsg);
$targetEpsg = preg_replace("/EPSG:/", "", $toEpsg);
$sql = "SELECT X(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as x, ";
- $sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y";
+ $sql .= "Y(transform(GeometryFromText('POINT(".$this->x." ".$this->y.")',".$currentEpsg."),".$targetEpsg.")) as y, ";
+ if (isset($this->z)) {
+ $sql .= "Z(transform(GeometryFromText('POINT(".$this->x." ".$this->y." ".$this->z.")',".$currentEpsg."),".$targetEpsg.")) as z";
+ }
$res = db_query($sql);
- $point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
+ if (isset($this->z)) {
+ $point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), db_result($res,0,"z"), $toEpsg);
+ }
+ else {
+ $point = new Mapbender_point(db_result($res,0,"x"), db_result($res,0,"y"), $toEpsg);
+ }
$this->x = $point->x;
$this->y = $point->y;
+ $this->z = $point->z;
$this->epsg = $point->epsg;
}
else {
@@ -169,7 +186,7 @@
}
function __toString() {
- return (string) "(" . $this->x . "," . $this->y . "," . $this->epsg . ")";
+ return (string) "(" . $this->x . "," . $this->y . "," . $this->z . "," . $this->epsg . ")";
}
}
?>
Modified: branches/nimix_dev/http/classes/class_wfs.php
===================================================================
--- branches/nimix_dev/http/classes/class_wfs.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_wfs.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -115,7 +115,7 @@
if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
$section = "getcapabilities";
}
- if($section == "getcapabilities" && strtoupper($element[tag]) == "GET"){
+ if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
$this->wfs_getcapabilities = $element[attributes][onlineResource];
}
@@ -126,7 +126,7 @@
}
- if($section == "describefeaturetype" && strtoupper($element[tag]) == "GET"){
+ if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
$this->wfs_describefeaturetype = $element[attributes][onlineResource];
}
@@ -134,7 +134,7 @@
if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
$section = "getfeature";
}
- if($section == "getfeature" && strtoupper($element[tag]) == "GET"){
+ if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
$this->wfs_getfeature = $element[attributes][onlineResource];
}
if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
@@ -144,7 +144,7 @@
if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
$section = "transaction";
}
- if($section == "transaction" && strtoupper($element[tag]) == "GET"){
+ if($section == "transaction" && strtoupper($element[tag]) == "POST"){
$this->wfs_transaction = $element[attributes][onlineResource];
}
if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
@@ -565,7 +565,7 @@
if(strtoupper($element[tag]) == "GETCAPABILITIES" && $element[type] == "open"){
$section = "getcapabilities";
}
- if($section == "getcapabilities" && strtoupper($element[tag]) == "GET"){
+ if($section == "getcapabilities" && strtoupper($element[tag]) == "POST"){
$this->wfs_getcapabilities = $element[attributes][onlineResource];
}
@@ -576,7 +576,7 @@
}
- if($section == "describefeaturetype" && strtoupper($element[tag]) == "GET"){
+ if($section == "describefeaturetype" && strtoupper($element[tag]) == "POST"){
$this->wfs_describefeaturetype = $element[attributes][onlineResource];
}
@@ -584,7 +584,7 @@
if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "open"){
$section = "getfeature";
}
- if($section == "getfeature" && strtoupper($element[tag]) == "GET"){
+ if($section == "getfeature" && strtoupper($element[tag]) == "POST"){
$this->wfs_getfeature = $element[attributes][onlineResource];
}
if(strtoupper($element[tag]) == "GETFEATURE" && $element[type] == "close"){
@@ -594,7 +594,7 @@
if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "open"){
$section = "transaction";
}
- if($section == "transaction" && strtoupper($element[tag]) == "GET"){
+ if($section == "transaction" && strtoupper($element[tag]) == "POST"){
$this->wfs_transaction = $element[attributes][onlineResource];
}
if(strtoupper($element[tag]) == "TRANSACTION" && $element[type] == "close"){
Modified: branches/nimix_dev/http/classes/class_wfs_conf.php
===================================================================
--- branches/nimix_dev/http/classes/class_wfs_conf.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/classes/class_wfs_conf.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -93,27 +93,19 @@
* @param $idArray Array an array of integer values representing WFS conf IDs.
*/
private static function getWfsConfFromDbByArray ($idArray) {
- $sql = "SELECT * FROM wfs_conf ";
- $sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
- $sql .= "WHERE wfs_conf.wfs_conf_id IN (";
-
- $v = array();
- $t = array();
- for ($i = 0; $i < count($idArray); $i++) {
- if ($i > 0) {$sql .= ", ";}
- $sql .= "$" . ($i+1);
- array_push($v, $idArray[$i]);
- array_push($t, 'i');
- }
- $sql .= ")";
-
- $res = db_prep_query($sql, $v, $t);
-
$rowArray = array();
- while ($row = db_fetch_array($res)) {
- array_push($rowArray, $row);
- }
- return $rowArray;
+ foreach ($idArray as $id) {
+ $sql = "SELECT * FROM wfs_conf ";
+ $sql .= "JOIN wfs ON wfs_conf.fkey_wfs_id = wfs.wfs_id ";
+ $sql .= "WHERE wfs_conf.wfs_conf_id = $1 LIMIT 1";
+
+ $v = array($id);
+ $t = array("i");
+ $res = db_prep_query($sql, $v, $t);
+ $row = db_fetch_array($res);
+ array_push($rowArray, $row);
+ }
+ return $rowArray;
}
/**
Modified: branches/nimix_dev/http/html/mod_treefolder2.php
===================================================================
--- branches/nimix_dev/http/html/mod_treefolder2.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/html/mod_treefolder2.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -684,7 +684,7 @@
if(temp.gui_layer_queryable!='1')
controls.push('disabled ');
controls.push("onclick=\"handleSelectedLayer('"+mod_treeGDE_map+"','"+parent.mb_mapObj[i].wms[ii].wms_id+"','"+temp.layer_name+"','querylayer',this.checked?1:0);");
- controls.push("handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1);\" />");
+ controls.push("handleSelection('"+parentObj+parentLayer+"|"+temp.layer_id+"', 1);\" />");
}
if(wmsbuttons == 'true'&&metadatalink == 'true'){
controls.push('<a href="javascript:openwindow(\''+ defaultMetadataUrl + '&id='+temp.layer_uid+'\');"><img src="'+imagedir+'/info.png" /></a>');
Modified: branches/nimix_dev/http/javascripts/geometry.js
===================================================================
--- branches/nimix_dev/http/javascripts/geometry.js 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/geometry.js 2008-10-07 08:15:38 UTC (rev 3137)
@@ -231,7 +231,7 @@
var q = this.get(0).get(0).get(0);
var min = cloneObject(q);
var max = cloneObject(q);
- for(var i=0; i<this.count();i++){
+ for(var i=0; i < this.count();i++){
var pos = this.get(i).getBBox();
if (pos[0].x < min.x) {min.x = pos[0].x;}
if (pos[1].x > max.x) {max.x = pos[1].x;}
@@ -363,7 +363,7 @@
this.addMember(geomType.point);
this.get(-1).addGeometry();
- this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0], coordinates[1]);
+ this.getGeometry(-1,-1).addPointByCoordinates(coordinates[0], coordinates[1], coordinates[2]);
this.getGeometry(-1,-1).setEpsg(featureEpsg);
this.close();
break;
@@ -376,7 +376,7 @@
this.get(-1).addGeometry();
for (var m = 0; m < coordinates.length; m++) {
var currentPoint = coordinates[m];
- this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+ this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
}
this.getGeometry(-1,-1).setEpsg(featureEpsg);
this.close();
@@ -392,7 +392,7 @@
var currentLine = coordinates[m];
for (var n = 0; n < currentLine.length; n++) {
var currentPoint = currentLine[n];
- this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+ this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
}
this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
@@ -409,7 +409,7 @@
var currentPolygon = coordinates[m];
for (var n = 0; n < currentPolygon.length; n++) {
var currentPoint = currentPolygon[n];
- this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+ this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
}
this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
@@ -426,7 +426,7 @@
var currentPolygon = coordinates[m];
for (var n = 0; n < currentPolygon.length; n++) {
var currentPoint = currentPolygon[n];
- this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1]);
+ this.getGeometry(-1,-1).addPointByCoordinates(currentPoint[0], currentPoint[1], currentPoint[2]);
}
this.getGeometry(-1,-1).setEpsg(featureEpsg);
}
@@ -1498,7 +1498,7 @@
var diameter = 8;
var minWidth = 8;
- var lineWidth = aLineWidth;
+ var lineWidth = aLineWidth || 2;
var mapframe = aMapframe;
var mapObjInd = getMapObjIndexByName(mapframe);
var mapframeWidth = mb_mapObj[mapObjInd].width;
@@ -1964,7 +1964,7 @@
for (attr in a) {
var b = a[attr];
if (typeof(b) == "object") {z += objString(b);}
- else {z += attr + " " + b + "\n";alert(attr + " " + b);}
+ else {z += attr + " " + b + "\n";}
}
return z;
}
Modified: branches/nimix_dev/http/javascripts/map.js
===================================================================
--- branches/nimix_dev/http/javascripts/map.js 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/map.js 2008-10-07 08:15:38 UTC (rev 3137)
@@ -438,32 +438,22 @@
}
else if(validation){
newfeatureInfoRequest += requestParams;
- (function () {
- var currentRequest = newfeatureInfoRequest;
- mb_ajax_post(path,{url:currentRequest},function(js_code,status){
- if(js_code){
- try{
- var p = new mb_popup({
- title:"Feature Info",
- url:currentRequest,
- width:600,
- height:500,
- top:200,
- left:600
- });
- p.show();
- }
- catch(e){
- window.open(currentRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
- }
- }
- else{
- var e = new Mb_exception("No featureInfo results.");
- }
+ try{
+ var p = new mb_popup({
+ title:"Feature Info",
+ url:newfeatureInfoRequest,
+ width:600,
+ height:500,
+ top:200,
+ left:600
});
- }());
+ p.show();
+ }
+ catch(e){
+ window.open(newfeatureInfoRequest, "" , "width=300,height=400,scrollbars=yes,resizable=yes");
+ }
cnt_fi++;
- }
+ }
}
}
}
Modified: branches/nimix_dev/http/javascripts/map.php
===================================================================
--- branches/nimix_dev/http/javascripts/map.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/map.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -74,7 +74,7 @@
// Load external JavaScript libraries
//
$extPath = dirname(__FILE__) . "/../extensions/";
-$extFileArray = array( "jquery-1.2.6.min.js",
+$extFileArray = array( "jquery.js",
"jqjson.js",
"jquery.mousewheel.min.js");
Modified: branches/nimix_dev/http/javascripts/mod_highlightPOI.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_highlightPOI.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/mod_highlightPOI.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -67,14 +67,14 @@
function mod_highlightPOI_init(){
var myPOI = "<?php if (CHARSET == 'UTF-8'){
- echo utf8_encode($_SESSION['mb_myPOI']);
+ echo preg_replace("/\n/", "<br>", $_SESSION['mb_myPOI']);
}else{
- echo $_SESSION['mb_myPOI'];
+ echo preg_replace("/\n/", "<br>", utf8_decode($_SESSION['mb_myPOI']));
}
?>";
if(myPOI != ""){
- mod_highlightPOI_params = myPOI.split(",");
+ mod_highlightPOI_params = myPOI.split("|");
Modified: branches/nimix_dev/http/javascripts/mod_savewmc.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_savewmc.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/mod_savewmc.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -37,7 +37,10 @@
try {if (saveInSession) {}}catch(e) {saveInSession = 0;}
if (saveInSession == 1) {
- mb_registerInitFunctions('setOnUnload()');
+ eventAfterMapRequest.register(function () {
+ mod_savewmc_session();
+ });
+// mb_registerInitFunctions('setOnUnload()');
}
<?php
Modified: branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/mod_wfs_SpatialRequest.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -60,7 +60,6 @@
var button_rectangle = "rectangle";
var button_extent = "extent";
var button_dialogue = "dialogue";
-var mb_wfs_tolerance = 8;
var activeButton = null;
var mod_wfs_spatialRequest_geometry = null;
@@ -93,7 +92,7 @@
var msgObj;
mb_registerInitFunctions("init_wfsSpatialRequest()");
-mb_registerL10nFunctions("init_wfsSpatialRequest()");
+//mb_registerL10nFunctions("init_wfsSpatialRequest()");
function init_wfsSpatialRequest() {
mb_ajax_json("../php/mod_wfsSpatialRequest_messages.php", function(obj, status) {
@@ -576,7 +575,7 @@
var mapPosYRemovePix = mapPos[1] - buffer;
var realWorld1 = makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYRemovePix);
var realWorld2 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
- var realWorld3 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYAddPix);
+ var realWorld3 = makeClickPos2RealWorldPos("mapframe1",mapPosXAddPix,mapPosYRemovePix);
var realWorld4 = makeClickPos2RealWorldPos("mapframe1",mapPosXRemovePix,mapPosYAddPix);
for(var i=0; i<js_wfs_conf_id.length; i++){
var srs = wfs_config[js_wfs_conf_id[i]]['featuretype_srs'];
@@ -782,4 +781,4 @@
}
if(wfsResultToPopupDiv==1){
mb_registerWfsReadSubFunctions(function(geom){displayPopup(geom);});
-}
\ No newline at end of file
+}
Modified: branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php
===================================================================
--- branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/mod_wfs_gazetteer_client.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -84,7 +84,6 @@
var button_polygon = "polygon";
var button_rectangle = "rectangle";
var button_extent = "extent";
-var mb_wfs_tolerance = 8;
var activeButton = null;
var mod_wfs_spatialRequest_geometry = null;
Modified: branches/nimix_dev/http/javascripts/wfs.js
===================================================================
--- branches/nimix_dev/http/javascripts/wfs.js 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/wfs.js 2008-10-07 08:15:38 UTC (rev 3137)
@@ -1,33 +1,166 @@
-<?php
-#$Id$
-#$Header: /cvsroot/mapbender/mapbender/http/javascripts/mod_wfs_spatialRequest.php,v 1.4 2006/03/08 15:26:26 c_baudson Exp $
-# Copyright (C) 2002 CCGIS
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2, or (at your option)
-# any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+// ---------------------------------------------------------------------------------------------------------------
+// --- usemap (begin) --------------------------------------------------------------------------------------------
-session_start();
-import_request_variables("PG");
-require_once(dirname(__FILE__) . "/../php/mb_validateSession.php");
-require_once(dirname(__FILE__) . "/../../conf/mapbender.conf");
-$con = db_connect(DBSERVER,OWNER,PW);
-db_select_db(DB,$con);
+function mod_usemap(wfs_name) {
+ if (wfs_name == "") {
+ usemap = "";
+ }
+ var ind = getMapObjIndexByName(mb_wfs_target);
+ var myImg = window.frames[mb_wfs_target].document.getElementById("um_img").style;
+ myImg.width = mb_mapObj[ind].width;
+ myImg.height = mb_mapObj[ind].height;
-$e_id_css = "wfs";
-include '../include/dyn_js.php';
-require_once(dirname(__FILE__) . "/wfs_usemap.js");
-?>
+ for (var i = 0 ; i < mb_wfs_fetch.count() ; i ++) {
+ if (mb_wfs_fetch.get(i).wfs_conf == wfs_name || wfs_name == "") {
+
+ if (mb_wfs_fetch.get(i).geomType == geomType.polygon) {
+ usemap += mod_usemap_polygon(i);
+ }
+ else if (mb_wfs_fetch.get(i).geomType == geomType.point) {
+ usemap += mod_usemap_circle(i);
+ }
+ else if (mb_wfs_fetch.get(i).geomType == geomType.line) {
+ usemap += mod_usemap_line(i);
+ }
+ }
+ }
+ writeUsemap(usemap);
+}
+
+function mod_usemap_circle(ind){
+ var str = "";
+ var coord = "";
+
+ var title = "";
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+ if (i>0) title += " ";
+ title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+ }
+
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+ var p = mb_wfs_fetch.getPoint(ind, i, 0);
+ var pos = realToMap(mb_wfs_target,p);
+ coord += pos.x + ", " + pos.y;
+
+ str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle' coords='";
+ str += coord + ", " + mod_usemap_radius + "' href='#'>";
+ }
+
+ return str;
+}
+
+function mod_usemap_line_calculate (aGeometry, j, orientation, cnt) {
+ var coord = "";
+
+ var p1 = realToMap(mb_wfs_targets[0],aGeometry.get(j));
+ var p2 = realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));
+
+ var vec = p2.minus(p1);
+
+ if (vec.x != 0 || vec.y != 0) {
+ var n_vec;
+ if (vec.x != 0) {
+ if (vec.x > 0) n_vec = new Point((-vec.y)/vec.x, -1);
+ else n_vec = new Point(vec.y/vec.x, 1);
+ }
+ else {
+ if (vec.y > 0) n_vec = new Point(1,0);
+ else n_vec = new Point(-1,0);
+ }
+ n_vec = n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
+
+ lp = new Point(p1.x + n_vec.x, p1.y - n_vec.y);
+
+ if (cnt > 0) coord += ", ";
+
+ coord += parseInt(lp.x) + ", " + parseInt(lp.y);
+ coord += ", " + parseInt(lp.x+vec.x) + ", " + parseInt(lp.y+vec.y);
+ }
+ return coord;
+}
+
+function mod_usemap_line(ind){
+ var str = "";
+ var title = "";
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+ if (i>0) title += " ";
+ title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+ }
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+ var coord = "";
+ var cnt = 0;
+
+ for (var j = 0 ; j < mb_wfs_fetch.getGeometry(ind,i).count() - 1 ; j ++) {
+ var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, 1, cnt);
+ if (result != "") {
+ coord += result;
+ cnt++;
+ }
+ }
+
+ for (var j = (mb_wfs_fetch.getGeometry(ind,i).count() - 1) ; j > 0 ; j--) {
+ var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, -1, cnt);
+ if (result != "") {
+ coord += result;
+ cnt++;
+ }
+ }
+
+ if (coord != "") {
+ str += "<AREA title='"+title+"'";
+ str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";
+ str += "shape='poly' coords='";
+ str += coord + "' href='#'>";
+ }
+ else {
+ //display circle
+ var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));
+ coord += pos.x + ", " + pos.y;
+
+ str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle' coords='";
+ str += coord + ", " + mod_usemap_radius + "' href='#'>";
+ }
+ }
+
+ return str;
+}
+
+function mod_usemap_polygon(ind){
+ var str = "";
+ var coord = "";
+ var title = "";
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
+ if (i>0) title += " ";
+ title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
+ }
+
+ for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
+ var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, 0));
+ coord += pos.x + ", " + pos.y;
+
+ for (var j = 1 ; j < mb_wfs_fetch.getGeometry(ind,i).count() ; j ++) {
+ pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, j));
+ coord += ", " + pos.x + ", " + pos.y;
+ }
+
+ str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
+ str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly' coords='";
+ str += coord + "' href='#'>";
+ }
+
+ return str;
+}
+
+function writeUsemap(str) {
+ writeTag(mb_wfs_targets[0], 'um', str);
+}
+// --- usemap (end) ----------------------------------------------------------------------------------------------
+// ---------------------------------------------------------------------------------------------------------------
+
+
var highlight_tag_id = "wfs_highlight_tag";
var mb_wfs_fetched = [];
@@ -86,14 +219,14 @@
var ind = getMapObjIndexByName(mb_wfs_targets[0]);
var pos_a = makeClickPos2RealWorldPos(mb_wfs_targets[0],0,0);
var pos_b = makeClickPos2RealWorldPos(mb_wfs_targets[0],mb_mapObj[ind].width,mb_mapObj[ind].height);
-
+
var x = [];
var y = [];
x[0] = pos_a[0];
x[1] = pos_b[0];
y[0] = pos_a[1];
y[1] = pos_b[1];
-
+
mb_setwfsrequest(mb_wfs_targets[0],'rectangle',x,y);
}
}
@@ -133,7 +266,7 @@
function mb_wfs_reset(){
mb_wfs_fetch = new parent.GeometryArray();
usemap = "";
-
+
if(mb_wfs_objwin == null){
var iframe=document.createElement('div');
iframe.setAttribute("style","position:absolute;left:"+mb_wfs_objwin_left+"px;top:"+mb_wfs_objwin_top+"px;width:"+mb_wfs_objwin_width+"px;height:"+mb_wfs_objwin_height+"px");
@@ -183,7 +316,7 @@
highlight.del(m, '#ff0000');
highlight.paint();
}
- else
+ else
if (type == 'click') {
var tmp = m.getBBox();
if (m.geomType == geomType.point) {
@@ -205,17 +338,17 @@
function get_wfs_str(myconf, d, m, type, fid) {
- <!-- Getting the Namspace for the FeautureType -->
+ <!-- Getting the Namspace for the FeautureType -->
var featureTypeArray = myconf['featuretype_name'].split(':')
var featureNS = featureTypeArray[0];
var str = '<wfs:Transaction version="1.0.0" service="WFS" ';
var ns_gml = false; var ns_ogc = false; var ns_xsi = false; var ns_wfs = false; var ns_featureNS = false;
-
+
for (var q = 0 ; q < myconf['namespaces'].length ; q++) {
-
- if (myconf['namespaces'][q]['name'] == "gml"){
+
+ if (myconf['namespaces'][q]['name'] == "gml"){
ns_gml = true;
str += 'xmlns:' + myconf['namespaces'][q]['name'] + '="' + myconf['namespaces'][q]['location'] + '" ';
} else if (myconf['namespaces'][q]['name'] == "ogc") {
@@ -233,13 +366,13 @@
strForSchemaLocation = myconf['namespaces'][q]['location'];
}
}
-
+
if (ns_gml == false) str += 'xmlns:gml="http://www.opengis.net/gml" ';
if (ns_ogc == false) str += 'xmlns:ogc="http://www.opengis.net/ogc" ';
if (ns_xsi == false) str += 'xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ';
if (ns_featureNS == false) str += 'xmlns:"+featureNS+"="http://www.someserver.com/"+featureNS+"" ';
if (ns_wfs == false) str += 'xmlns:wfs="http://www.opengis.net/wfs" ';
-
+
str += 'xsi:schemaLocation="http://www.opengis.net/wfs';
str += ' http://schemas.opengis.net/wfs/1.0.0/WFS-transaction.xsd';
str += ' ' + strForSchemaLocation;
@@ -261,24 +394,24 @@
}
for(var j=0; j<myconf['element'].length; j++){
if(myconf['element'][j]['f_geom'] == 1){
- var el_geom = myconf['element'][j]['element_name'];
+ var el_geom = myconf['element'][j]['element_name'];
}
}
- str += '<' + el_geom + '>';
+ str += '<' + el_geom + '>';
if(d.get(m).geomType == geomType.point){
str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '">';
str += '<gml:coordinates>';
- str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
+ str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
str += '</gml:coordinates>';
- str += '</gml:Point>';
+ str += '</gml:Point>';
}
if(d.get(m).geomType == geomType.line){
str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
for(var k=0; k<d.getGeometry(m,0).count(); k++){
- if(k>0) str += " ";
+ if(k>0) str += " ";
str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
- }
+ }
str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
str += '</gml:MultiLineString>';
}
@@ -287,12 +420,12 @@
str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
for(var k=0; k<d.getGeometry(m,0).count(); k++){
- if(k>0) str += " ";
+ if(k>0) str += " ";
str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
- }
+ }
str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
}
- str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';
+ str += '</' + el_geom + '></'+ myconf['featuretype_name']+'></wfs:Insert>';
}
//
// --------------------------------------- UPDATE ------------------------------------------------
@@ -309,22 +442,22 @@
}
for(var j=0; j<myconf['element'].length; j++){
if(myconf['element'][j]['f_geom'] == 1){
- var el_geom = myconf['element'][j]['element_name'];
+ var el_geom = myconf['element'][j]['element_name'];
}
}
str += '<wfs:Property><wfs:Name>' + el_geom + '</wfs:Name><wfs:Value>';
if(d.get(m).geomType == geomType.point){
str += '<gml:Point srsName="' + myconf['featuretype_srs'] + '"><gml:coordinates>';
- str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
- str += '</gml:coordinates></gml:Point>';
+ str += d.getPoint(m,0,0).x + "," + d.getPoint(m,0,0).y;
+ str += '</gml:coordinates></gml:Point>';
}
if(d.get(m).geomType == geomType.line){
str += '<gml:MultiLineString srsName="' + myconf['featuretype_srs'] + '">';
str += '<gml:lineStringMember><gml:LineString><gml:coordinates>';
for(var k=0; k<d.getGeometry(m,0).count(); k++){
- if(k>0) str += " ";
+ if(k>0) str += " ";
str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
- }
+ }
str += '</gml:coordinates></gml:LineString></gml:lineStringMember>';
str += '</gml:MultiLineString>';
}
@@ -332,9 +465,9 @@
str += '<gml:MultiPolygon srsName="' + myconf['featuretype_srs'] + '">';
str += '<gml:polygonMember><gml:Polygon><gml:outerBoundaryIs><gml:LinearRing><gml:coordinates>';
for(var k=0; k<d.getGeometry(m,0).count(); k++){
- if(k>0) str += " ";
+ if(k>0) str += " ";
str += d.getPoint(m,0,k).x + "," + d.getPoint(m,0,k).y;
- }
+ }
str += '</gml:coordinates></gml:LinearRing></gml:outerBoundaryIs></gml:Polygon></gml:polygonMember></gml:MultiPolygon>';
}
str += '</wfs:Value></wfs:Property>';
@@ -348,13 +481,13 @@
str += '<wfs:Delete typeName="'+ myconf['featuretype_name']+'">';
for(var j=0; j<myconf['element'].length; j++){
if(myconf['element'][j]['f_geom'] == 1){
- var el_geom = myconf['element'][j]['element_name'];
+ var el_geom = myconf['element'][j]['element_name'];
}
}
str += '<ogc:Filter><ogc:FeatureId fid="'+fid+'"/></ogc:Filter>';
str += '</wfs:Delete>';
}
-
+
str += '</wfs:Transaction>';
return str;
-}
+}
\ No newline at end of file
Deleted: branches/nimix_dev/http/javascripts/wfs_usemap.js
===================================================================
--- branches/nimix_dev/http/javascripts/wfs_usemap.js 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/javascripts/wfs_usemap.js 2008-10-07 08:15:38 UTC (rev 3137)
@@ -1,167 +0,0 @@
-/*
-* $Id$
-* COPYRIGHT: (C) 2001 by ccgis. This program is free software under the GNU General Public
-* License (>=v2). Read the file gpl.txt that comes with Mapbender for details.
-*/
-
-// ---------------------------------------------------------------------------------------------------------------
-// --- usemap (begin) --------------------------------------------------------------------------------------------
-
-function mod_usemap(wfs_name) {
- if (wfs_name == "") {
- usemap = "";
- }
- var ind = getMapObjIndexByName(mb_wfs_target);
- var myImg = window.frames[mb_wfs_target].document.getElementById("um_img").style;
- myImg.width = mb_mapObj[ind].width;
- myImg.height = mb_mapObj[ind].height;
-
- for (var i = 0 ; i < mb_wfs_fetch.count() ; i ++) {
- if (mb_wfs_fetch.get(i).wfs_conf == wfs_name || wfs_name == "") {
-
- if (mb_wfs_fetch.get(i).geomType == geomType.polygon) {
- usemap += mod_usemap_polygon(i);
- }
- else if (mb_wfs_fetch.get(i).geomType == geomType.point) {
- usemap += mod_usemap_circle(i);
- }
- else if (mb_wfs_fetch.get(i).geomType == geomType.line) {
- usemap += mod_usemap_line(i);
- }
- }
- }
- writeUsemap(usemap);
-}
-
-function mod_usemap_circle(ind){
- var str = "";
- var coord = "";
-
- var title = "";
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
- if (i>0) title += " ";
- title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
- }
-
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
- var p = mb_wfs_fetch.getPoint(ind, i, 0);
- var pos = realToMap(mb_wfs_target,p);
- coord += pos.x + ", " + pos.y;
-
- str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
- str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle' coords='";
- str += coord + ", " + mod_usemap_radius + "' href='#'>";
- }
-
- return str;
-}
-
-function mod_usemap_line_calculate (aGeometry, j, orientation, cnt) {
- var coord = "";
-
- var p1 = realToMap(mb_wfs_targets[0],aGeometry.get(j));
- var p2 = realToMap(mb_wfs_targets[0],aGeometry.get(j+orientation));
-
- var vec = p2.minus(p1);
-
- if (vec.x != 0 || vec.y != 0) {
- var n_vec;
- if (vec.x != 0) {
- if (vec.x > 0) n_vec = new Point((-vec.y)/vec.x, -1);
- else n_vec = new Point(vec.y/vec.x, 1);
- }
- else {
- if (vec.y > 0) n_vec = new Point(1,0);
- else n_vec = new Point(-1,0);
- }
- n_vec = n_vec.times(mod_usemap_line_tolerance).dividedBy(n_vec.dist(new Point(0,0)))
-
- lp = new Point(p1.x + n_vec.x, p1.y - n_vec.y);
-
- if (cnt > 0) coord += ", ";
-
- coord += parseInt(lp.x) + ", " + parseInt(lp.y);
- coord += ", " + parseInt(lp.x+vec.x) + ", " + parseInt(lp.y+vec.y);
- }
- return coord;
-}
-
-function mod_usemap_line(ind){
- var str = "";
- var title = "";
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
- if (i>0) title += " ";
- title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
- }
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
- var coord = "";
- var cnt = 0;
-
- for (var j = 0 ; j < mb_wfs_fetch.getGeometry(ind,i).count() - 1 ; j ++) {
- var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, 1, cnt);
- if (result != "") {
- coord += result;
- cnt++;
- }
- }
-
- for (var j = (mb_wfs_fetch.getGeometry(ind,i).count() - 1) ; j > 0 ; j--) {
- var result = mod_usemap_line_calculate(mb_wfs_fetch.getGeometry(ind,i), j, -1, cnt);
- if (result != "") {
- coord += result;
- cnt++;
- }
- }
-
- if (coord != "") {
- str += "<AREA title='"+title+"'";
- str += "onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
- str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' ";
- str += "shape='poly' coords='";
- str += coord + "' href='#'>";
- }
- else {
- //display circle
- var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind,i,0));
- coord += pos.x + ", " + pos.y;
-
- str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch["+ind+"])' ";
- str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='circle' coords='";
- str += coord + ", " + mod_usemap_radius + "' href='#'>";
- }
- }
-
- return str;
-}
-
-function mod_usemap_polygon(ind){
- var str = "";
- var coord = "";
- var title = "";
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).e.count(); i++) {
- if (i>0) title += " ";
- title += mb_wfs_fetch.get(ind).e.getName(i) + ": " + mb_wfs_fetch.get(ind).e.getValue(i);
- }
-
- for (var i = 0 ; i < mb_wfs_fetch.get(ind).count() ; i ++) {
- var pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, 0));
- coord += pos.x + ", " + pos.y;
-
- for (var j = 1 ; j < mb_wfs_fetch.getGeometry(ind,i).count() ; j ++) {
- pos = realToMap(mb_wfs_targets[0],mb_wfs_fetch.getPoint(ind, i, j));
- coord += ", " + pos.x + ", " + pos.y;
- }
-
- str += "<AREA title='"+title+"' onmouseover='parent.mb_wfs_perform(\"over\",parent.mb_wfs_fetch.get("+ind+"))' ";
- str += "onmouseout='parent.mb_wfs_perform(\"out\",parent.mb_wfs_fetch.get("+ind+"))' shape='poly' coords='";
- str += coord + "' href='#'>";
- }
-
- return str;
-}
-
-function writeUsemap(str) {
- writeTag(mb_wfs_targets[0], 'um', str);
-}
-// --- usemap (end) ----------------------------------------------------------------------------------------------
-// ---------------------------------------------------------------------------------------------------------------
Modified: branches/nimix_dev/http/php/mod_forgottenPassword.php
===================================================================
--- branches/nimix_dev/http/php/mod_forgottenPassword.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/php/mod_forgottenPassword.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -18,7 +18,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
import_request_variables("PG");
-require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+require_once(dirname(__FILE__)."/../../core/globalSettings.php");
require_once(dirname(__FILE__)."/../classes/class_administration.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
Modified: branches/nimix_dev/http/php/mod_meetingPoint.php
===================================================================
--- branches/nimix_dev/http/php/mod_meetingPoint.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/php/mod_meetingPoint.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -221,7 +221,7 @@
my_meetingPoint += encodeURIComponent(document.forms[0].mytext.value);
- my_meetingPoint += "," + document.forms[0].x.value + ",";
+ my_meetingPoint += "|" + document.forms[0].x.value + "|";
my_meetingPoint += document.forms[0].y.value;
if(meetingPoint_export_format == 'email'){
Copied: branches/nimix_dev/http/php/mod_showGuiName.php (from rev 3136, trunk/mapbender/http/php/mod_showGuiName.php)
===================================================================
--- branches/nimix_dev/http/php/mod_showGuiName.php (rev 0)
+++ branches/nimix_dev/http/php/mod_showGuiName.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -0,0 +1,42 @@
+<?php
+# $Id$
+#http://www.mapbender.org/ShowGuiName
+# Copyright (C) 2002 CCGIS
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+import_request_variables("PG");
+require_once(dirname(__FILE__)."/../php/mb_validateSession.php");
+?>
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
+<html>
+<head>
+<?php
+echo '<meta http-equiv="Content-Type" content="text/html; charset='.CHARSET.'">';
+?>
+<title>Show User</title>
+<?php
+include '../include/dyn_css.php';
+?>
+</head>
+<body leftmargin="5" topmargin="0">
+<?php
+$guiName=$_REQUEST["gui_name"];
+
+echo "<div class='text4'>".$gui_id."</div>";
+
+?>
+</body>
+</html>
\ No newline at end of file
Modified: branches/nimix_dev/http/print/mod_printPDF_pdf.php
===================================================================
--- branches/nimix_dev/http/print/mod_printPDF_pdf.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/print/mod_printPDF_pdf.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -57,6 +57,9 @@
$map_scale = $_REQUEST["map_scale"];
$overview_url = $_REQUEST["overview_url"];
$epsg = $_REQUEST["epsg"];
+if($overview_url=='false'){
+ $overview = false;
+}
function setscalebar($scale){
$mb_resolution = 28.35;
Modified: branches/nimix_dev/http/tools/mod_monitorCapabilities_read.php
===================================================================
--- branches/nimix_dev/http/tools/mod_monitorCapabilities_read.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/http/tools/mod_monitorCapabilities_read.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -237,11 +237,11 @@
$str .= "</tr></table></td>";
# $str .= "\n\t\t\t<td><a href='output_".$wms_id[$k]."_".$max.".txt' target=_blank>log</a></td>";
- $str .= "\n\t\t<td><input type=button value='details' onclick=\"var newWindow = window.open('../php/mod_monitorCapabilities_read_single.php?wmsid=".$wms_id[$k]."','wms','width=500,height=700,scrollbars');newWindow.href.location='test.php'\"></td></tr>";
+ $str .= "\n\t\t<td><input type=button value='details' onclick=\"var newWindow = window.open('../tools/mod_monitorCapabilities_read_single.php?wmsid=".$wms_id[$k]."','wms','width=500,height=700,scrollbars');newWindow.href.location='test.php'\"></td></tr>";
$cnt++;
}
$str .= "\n\t</table>\n\t<br/><input type=hidden name=cbs value='".$cnt."'>\n</form>";
echo $str;
?>
-</body></html>
\ No newline at end of file
+</body></html>
Modified: branches/nimix_dev/last_merged.txt
===================================================================
--- branches/nimix_dev/last_merged.txt 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/last_merged.txt 2008-10-07 08:15:38 UTC (rev 3137)
@@ -1 +1 @@
-trunk: 2914
\ No newline at end of file
+trunk: 3137
\ No newline at end of file
Modified: branches/nimix_dev/owsproxy/http/index.php
===================================================================
--- branches/nimix_dev/owsproxy/http/index.php 2008-10-07 07:55:13 UTC (rev 3136)
+++ branches/nimix_dev/owsproxy/http/index.php 2008-10-07 08:15:38 UTC (rev 3137)
@@ -64,6 +64,8 @@
}
else{
// check session
+session_regenerate_id();
+session_destroy();
session_id($_REQUEST["sid"]);
session_start();
if(!$_SESSION['mb_user_id']){
@@ -106,6 +108,18 @@
$request = $query->getRequest();
getImage($request);
break;
+ case 'map':
+ $arrayOnlineresources = checkWmsPermission($owsproxyService);
+ $query->setOnlineResource($arrayOnlineresources['wms_getmap']);
+ $layers = checkLayerPermission($arrayOnlineresources['wms_id'],$reqParams['layers']);
+ if($layers===""){
+ throwE("Permission denied");
+ die();
+ }
+ $query->setParam("layers",$layers);
+ $request = $query->getRequest();
+ getImage($request);
+ break;
case 'getlegendgraphic':
$url = getLegendUrl($query->getOwsproxyServiceId());
getImage($url);
More information about the Mapbender_commits
mailing list