Changes between Initial Version and Version 1 of MapContextHowto


Ignore:
Timestamp:
Jan 27, 2009, 2:24:55 PM (15 years ago)
Author:
jmckenna
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapContextHowto

    v1 v1  
     1= MapContext Howto =
     2
     3----
     4IMPORTANT NOTE: '' A formal HOWTO is now available at http://www.mapserver.org/ogc/mapcontext.html. This Wiki document is now considered out of date. ''
     5----
     6
     7Support for OGC Web Map Context has been added to MapServer in version 3.7. This allows client applications to load and save a map configuration in an standard XML format. Note that a context definition contains only references to WMS layers (CONNECTIONTYPE WMS).
     8
     9MapServer can read context documents of versions 0.1.2, 0.1.4 and 0.1.7 and can export contexts in versions 0.1.4 and 0.1.7.
     10
     11A copy of the OGC Web Map Context 0.1.4 specification can be downloaded from:
     12
     13    http://www.opengis.org/techno/discussions/02-066r1.pdf
     14
     15Special Build consideration
     16
     17Map Context support requires PROJ4, GDAL/OGR and PHP support libraries.
     18
     19Build/install the above libraries on your system and then build MapServer with the '--with-wmsclient --with-proj --with-php' configure options.
     20
     21Map Context options in a mapfile
     22
     23As mentioned above, a map context document can contain only references to WMS layers (CONNECTIONTYPE WMS). Please refer to the MapServer WMS Client HOWTO for more information on WMS layers. The following metadata are used by MapServer to handle map context information:
     24
     25Web object metadata
     26
     27- wms_context_version
     28    Version of the Map Context specification.
     29
     30- wms_context_fid
     31    Feature id of the context. Set to 0 if there's when saving if not specified.
     32
     33- wms_title
     34    This metadata does not exist anymore in version 0.1.7.
     35
     36- wms_keywordlist
     37
     38- wms_abstract
     39
     40- wms_logourl
     41    This metadata contains 4 elements space separated. The width of the image, the height, the format and the URL.
     42
     43- wms_dataurl
     44
     45- wms_contactperson
     46
     47- wms_contactorganization
     48
     49- wms_contactposition
     50
     51- wms_addresstype
     52
     53- wms_address
     54
     55- wms_city
     56
     57- wms_stateorprovince
     58
     59- wms_postcode
     60
     61- wms_country
     62
     63- wms_contactvoicetelephone
     64
     65- wms_contactfacsimiletelephone
     66
     67- wms_contactelectronicmailaddress
     68
     69Layer object metadata
     70
     71- wms_name
     72    Name of the WMS layer on the server.
     73
     74- wms_title
     75
     76- wms_abstract
     77
     78- wms_onlineresource
     79    URL to access the server.
     80
     81- wms_server_version
     82
     83- wms_formatlist
     84    List of available format for this layer.
     85
     86- wms_format
     87    Current format used.
     88
     89- wms_stylelist
     90    List of available style for this layer.
     91
     92- wms_style
     93    Current style used.
     94
     95- wms_style_%s_title
     96    Title of the layer. %s = The name of the style.
     97
     98- wms_style_%s_sld
     99    URL to the SLD document of this style. %s = The name of the style.
     100
     101- wms_style_%s_legendurl
     102    Location of an image describing the style. This metadata contains 4 elements separated by spaces. The width of the image, the height, the format and the URL. %s = The name of the style.
     103
     104Testing Map Context Support
     105
     106The first thing to do is to save your mapfile using the saveMapContext? function available from the php_mascript library. After, scan the XML output to look for <!-- WARNING: ... --> comments. Then take actions to fix every warning that you encounter. At the end of this you should have a mapfile compatible with the Map Context.
     107
     108Then you can load your new Map Context with a php_mapscript application. MapBrowser? from MapLab? is a good tool for that. With this tool you can load Map Context from othere servers with the loadMapContext? function from php_mapscript or save a mapfile into a Map Context.
     109
     110TODO, Known limitations
     111
     112Before 3.7 release
     113
     114- Need to validate request results against the corresponding XMLSchema files.
     115
     116-Maybe add a configure option (--with-context).
     117
     118Longer term TODO and limitations
     119
     120- Implement new metadata to separate all element from the wms_style_%s_legendurl. Because theyare space separated and the legendurl format can contain spaces and the legendurl url can contain commas.