Mod wmc2ol.php
From MapbenderWiki
Contents |
Description
english
The module is a webservice, that takes a wmc which was stored in the mapbender database and parse its structure. The structure will be written into a html page with an openlayers client. The openlayers client will have the same extent as the original mapbender client. The WMS should be identical. The difference to the mapbender client will be, that the openlayers html/javascript client will not need a session to be set before. It will only be pushed away as code. The services which are secured by mapbender will be erased before. The client can easily be integrated into other webpages or applications. It will be generated by giving the wmc_id as a GET parameter.
Examples
Example for a simple Url
http://www.geoportal.rlp.de/mapbender/php/mod_wmc2ol.php?wmc_id=45_1292507447
Integration into a webpage I
- Source Code
<html> <iframe src='http://www.geoportal.rlp.de/mapbender/php/mod_wmc2ol.php?wmc_id=45_1292507447' width='480' height='400' frameborder='0'> </iframe> </html>
Integration into a webpage II
- Source Code
<html> <iframe src='http://www.geoportal.rlp.de/mapbender/php/mod_wmc2ol.php?wmc_id=45_1292507447&withDigitize=1&xID=xCoord&yID=yCoord&LayerSwitcher=1&mb_myBBOX=6.5,48.5,7.5,50.6&mb_myBBOXEpsg=4326&mb_drawCentre=1&withDebug=1' width='480' height='400' frameborder='0'> </iframe> </html>
Integration into a webpage III
Supported Parameters
HTTP-GET
- wmc_id: The id of the wmc in the mapbender mb_user_wmc database table
- mb_myBBOX: Values of a Bounding Box to zoom to. Example: mb_myBBOX=7,50.5,7.5,51. The BBOX must be in the same CRS as the client was defined
- mb_myBBOXEpsg: Value of a EPSG Code in for which the given BBOX is defined. This is used to zoom to a special position with arbitrary coordinates. Example: mb_myBBOX=7.4,50.5,7.5,50.6&mb_myBBOXEpsg=4326
- mb_showCoords: If this is set to 1 a little red ballon marker is shown in the centre of the map
- withDigitize: If this is set to 1 the openlayers client has an event to push the coordinates of the point where this was done to a special html element. The value of this element is changed. The element names must be given as GET parameters to (xID and yID)
- xID: name of the field whose value should be set to the digitized x coordinate value
- yID: name of the field whose value should be set to the digitized y coordinate value
- withDebug: if this is set to 1, two dummy fields are generated which shows the x and y values of the digitized (clicked) points - their html names are xCoord and yCoord
- LayerSwitcher: If this is set to 1, the openlayers layer switcher is also shown
- GEORSS: This parameter contains a georss feed of point values. The point objects are parsed an will be written to the javascript code. The rendered points has click events which gives a ballon field with title/description/link elements of the feed
- pointRadius: This element controls the radius of the rendered point objects from the georss feed
- fillColor: This element controls the color of the point elements from the georss feed
- withoutBody: If this is set to 1, the html elements will not be written. This is a simple possibility to integrate the client into external forms
- mb_drawCentre: If this is set to 1 the openlayers client will have a marker at the centre of the map or applications
- disableMouseScroll: If this is set to 1, the client will have disabled the mousewheel zoom!
HTTP-POST
- GEORSS: This parameter contains a georss feed of point values. The point objects are parsed an will be written to the javascript code. The rendered points has click events which gives a ballon field with title/content/link elements of the feed. The coordinates of the points will be transformed into the crs of the client (via postgis function). The feed may have its own images which can be defined per object. If this is not given, the client defaults to the symbolization which was defined per GET Params. The size of the images can be defined too.
Example Feed
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"
xmlns:georss="http://www.georss.org/georss"
xmlns:gml="http://www.opengis.net/gml">
<title>Test GeoRSS</title>
<subtitle>Test GeoRSS subtitle</subtitle>
<link href="http://www.mapbender.org/"/>
<updated>2010-12-02T17:35:01Z</updated>
<author>
<name>Armin Retterath</name>
<email>armin.retterath@lvermgeo.rlp.de</email>
</author>
<id>http://www.geoportal.rlp.de</id>
<entry>
<title>Stadt Muster - Bürgerservice</title>
<link href="http://www.mapbender.org"/>
<id>xyz</id>
<updated>2010-12-02T07:02:32Z</updated>
<content><![CDATA[some data]]></content>
<imageUrl href="http://a.dryicons.com/images/icon_sets/socialize_icons_set/png/128x128/twitter.png"/>
<imageSize>70</imageSize>
<georss:where>
<gml:Point srsName="EPSG:31466">
<gml:pos>2629321.25 5591157.95</gml:pos>
</gml:Point>
</georss:where>
</entry>
</feed>
deutsch
Files
For this module the following files are required / Für dieses Modul werden die folgenden Dateien benötigt:
SQL
not needed
