UseMap
From MapbenderWiki
User:Uli Rothstein (Module maintainer)
Contents |
Description
english
With each Maprequest the Module UseMap starts a request to a WFS. The objects (just pointobjects for now) will be overlayed in the map and are mouse-sensitive.
Installation
- For drawing geometries the free Graphiclibrary (LGPL) wz_jsgraphics.js will be used. It will be included in a particular Mapbender-GUI as a separate Modul
- The JavaScript-Functionality will be included in Mapbender with the Module 'usermap'. This Module will be included as an IFRAME and will also be used for data transfer between WFS and Mapbender. For editing data (gml) another script with the same name (see register 'php') is required. In this file the configuration of the WFS within this prototype is made.
How to configure the usemap-modul
- Notice
There can only be one usemap-modul integrate in a gui. To enable more then one usemap-modul in a GUI a redisign of the modul would be necessary.
There are two files you have to adapt.
/javascripts/mod_usemap.php
- define the getFeature_Request
(line 21)var mod_usemap_wfs = "<url>";
mod_usemap_wfs has to sign on an valid getFeature-request. At the moment only point-objects are possible
For example:
var mod_usemap_wfs = "http://wms1.ccgis.de/cgi-bin/mapserv?map=/data/umn/mapbender_user/mapbender_user.map&Request=getFeature&Version=1.0.0&Service=WFS&typename=Mapbender_Names";
- Link on tooltip
(line 49) str += " href='#'>";
Replace the # with a valid link. This link will be opened on click on the tooltip.
For example:
str += " href='http://mapbender.org/'>";
- cw_bndcolor and cw_fillcolor
Set the color of the circle which will be drawn
/php/mod_usemap.php
Decide which attributs to use for the tooltip-text:
(line 39) echo "um_title[um_title.length] ='".$g->getValueBySeparatedKey($ii,"name")."';";
Get the entries from the gml-tag you are interested in. Replace "name" with the desired tag-name.
For example:
echo "um_title[um_title.length] ='".$g->getValueBySeparatedKey($ii,"firstname")." ".$g->getValueBySeparatedKey($ii,"lastname")."';";
deutsch
Das Module UseMap fordert mit jeder Kartenanfrage eine Anfrage an einen WFS mit an. Die Objekte (bisher nur Punktobjekte) werden in der Karte überlagert und reagieren auf Mausereignisse.
Installation
- Für das Zeichnen der Geometrien wird die freie (LGPL) Grafikbibliothek wz_jsgraphics.js verwendet. Diese wird als gesondertes Modul in die jeweilige Mapbender-Oberfläche eingebunden.
- Die JavaScript-Funktionalität wird mit dem Modul 'usemap' in den Mapbender integriert. Dieses Modul wird als IFRAME eingebunden, das zudem für den Datentransfer zwischen WFS und Mapbender verwendet wird.
Für die Aufbereitung der Daten (GML) wird noch ein weiteres gleichnamiges Skript (im Verzeichnis 'php') benötigt. In dieser Datei wird in diesem Prototyp auch die Konfiguration des WFS vorgenommen!
Files
For this module the following files are required / Für dieses Modul werden die folgenden Dateien benötigt:
SQL
Use this sql statement to insert this module in the corresponding gui / Mit diesem SQL kann das Modul in die entsprechende GUI eingefügen werden:
wz_graphics
usemap
known issues
see all WFS related trac tickets

