wiki:XmlFileSettingsFive

TOC?

>> Back to manual

Settings in the XML file (config_default.xml)

for p.mapper version 5.x

<pmapper>

<!--
 Debug level: writes debugging info in pm_debug.log in the 
 same directory as PHP error log file requires php.ini 
 setting 'error_log' to be set to a valid file
 0: no debug 1: lowest debug level
-->
<debugLevel>3</debugLevel>


<!--
 PLUGINS activated
 a separate <plugins> tag for every plugin to be loaded
-->
<plugins>scalebar</plugins>
<plugins>transparency</plugins>

<config>

<!--
 Configuration directory under /config/
 - for js_config.php 
 - without slashes or backslashes
 - default value is: default
 === OPTIONAL ===
-->
<pm_config_location>default</pm_config_location>


<!--
 path of search config file for attribute search

 - relative file name under pm_config_location
 - or absolute path in filesystem (use slashes)
 default value is: inline
 === OPTIONAL ===
-->
<pm_search_configfile>default/search.xml</pm_search_configfile>

<!--
 WEB location for javascript dir
 === OPTIONAL ===
-->
<pm_javascript_location>js/src</pm_javascript_location>


<!--
 CONFIG FILEE FOR PRINTING
 path relative to /config/
 (same level as this <ini)
 defaults to common/print.xml
-->
<pm_print_configfile>common/print.xml</pm_print_configfile>

<map>

<mapFile>pmapper_demo.map</mapFile>

<!--
 Map file template used for highlighting query results
 use relative path towards /config/
 if not specified then default highlighting 
 is used applying values from highlightColor
-->
<tplMapFile>common/template.map</tplMapFile>

<projection>EPSG:900913</projection><!--  likely not needed...  -->

<-- 
This is where you define some layer properties in general, and how layers defined in the map file are displayed in TOC 

MapServer layers (groups) can be combined into one or more OpenLayer layers called "olThemes" in p.mapper to avoid ambiguities. 
olThemes based on MapServer can be defined as tiled (themeType="PMTile") or untiled (themeType="PMap", is the default). 
Tiled allows the combination with OSM or Google layers, but is stuck to the projection EPSG 900913.

An olTheme can contain a full category, or be just a single group inside a category. Nearly any conceivable type of mixing is possible, 
though for a first test it is recommended to place all Mapserver based layers inside a single olTheme.

- group: corresponds by default to to a MapServer group. A MapServer group can be a single MapServer layer or be composed of multiple MapServer layers.
         it is a synonym for thematic layers and is used also for layers based on OpenLayers definitions, like OSM, Google, etc
- olTheme: OpenLayers Layer object. All groups (layers) defined for a single olTheme are displayed on the same images returned from server
- name: category or group name. (Can be referred in js_config.php or in <tocdomains> plugin configuration tags)
- description: category or group description displayed in TOC
- imgFormat: image format used for display of group (usually png, png8, gif, or jpeg)
- themeType: according to this value several options are evaluated (eg. buffer, crs, ...). 
             Currently existing types: PMTile, PMap, OSM, Google, olnative
- buffer: buffer setting for tiled layer, see OpenLayers documentation for Layer class
- state: tells p.mapper to expand or collapse category in TOC at start-up. If not set, defaults to open.
- maxScale, minScale: uses min/maxScale for display. 
                      Similar to Mapserver MAXSCALEDENOM/MINSCALEDENOM (http://mapserver.org/mapfile/layer.html) 
                      but managed on client-side via OpenLayers 
- tileCache: use internal tile caching mechanism, writing image tiles to disk. Use "true" to activate. 
             Requires additional definition of <tileCacheRoot> with a directory (full absolute path) with write permissions for the web server user  
- cacheMaxLevel: in case tileCache is set to true, it is possible to define a maximum zoom level for tile caching.
                 levels higher than this limit are always rendered on the fly and not cached on disk.
-->
<categories>
    <category name="cat_admin" imgFormat="png32" olTheme="admin" buffer="0" themeType="PMTile">
        <group>countries</group>
        <group>admin</group>
        <group>cities10000eu</group>
        <group olTheme="urbanthm" imgFormat="png8" name="urban"></group>
    </category>
    <category name="cat_infra" olTheme="infra" imgFormat="png8" description="Infrastructure" state="closed" themeType="PMTile">
        <group>roads</group>
        <group>railroad</group>
    </category>
    <category name="cat_nature" olTheme="admin">
        <group>rivers</group>
        <group>lakes</group>
    </category>
    <category name="cat_raster">
        <group olTheme="bluemarblethm" imgFormat="jpeg" name="bluemarble" description="Blue Marble" buffer="1" themeType="PMTile" maxScale="1000000">/group>
        <group olTheme="reliefthm" imgFormat="jpeg" name="shaded_relief" buffer="1" themeType="PMTile" maxScale="1000000"></group>
    </category>
    <category name="cat_osm" description="OSM">
        <group olTheme="osmmapnik" name="osmmapnik" description="OpenStreetMap" themeType="OSM"></group>
    </category>
    <category name="cat_google" description="Google">
        <group olTheme="gsat" name="gsat" description="Google Satellite" themeType="Google" gmapType="SATELLITE"></group>
        <!--  gmapType: SATELLITE | HYBRID | STREETS | TERRAIN  -->
    </category>

    <!-- <group olTheme="bing_test" name="bing" themeType="OL"></group>  -->
</categories>


<--
    contains the order of olThemes (=OpenLayers layer objects) how they are added to the map: 
    last one overlaying the first ones, similar principle as with Mapserver layers
-->
     <olThemes>
         <theme>gsat</theme>
         <theme>osmmapnik</theme>
         <theme>reliefthm</theme>
         <theme>bluemarblethm</theme>
         <theme>admin</theme>
         <theme>urbanthm</theme>
         <theme>infra</theme>
      </olThemes>


<!--
 Default Groups (visible/activated on start-up)
 === RECOMMENDED ===
-->
<defGroups>
    <group>countries</group>
    <group>cities10000eu</group>
    <group>rivers</group>
    <group>osmmapnik</group>
</defGroups


<!--
 Groups/Layers list where to use auto_identify(tooltip) function
 === OPTIONAL ===
-->
<autoIdentifyGroups>

<!--
 Automatically refresh map when selection of 
 layers/grouops has changed in TOC
-->
<layerAutoRefresh>1</layerAutoRefresh>


<!--
 Image format for map and legend icons, like png, agg_png, jpeg
 formats with names defined in Map file OUTPUTFORMAT [http://mapserver.org/mapfile/outputformat.html]
-->
<imgFormat>png</imgFormat>

<!--
 alternative Image format for map 
 useful eg. for imagery data
 -->
<altImgFormat>jpeg</altImgFormat>

<!--
 Define start and end scale for zoom slider
 => Adapt to specific extents of the datasets
 or use 'max' for automatically calculate from map file
-->
<sliderMax>max</sliderMax>
<sliderMin>100000</sliderMin>

<query>

<!--
 Limit for results of selection with select tool or search
-->
<limitResult>300</limitResult>

<!--
 Highlight color for identify/search zoom in
 RGB values, separated with commas
 See also <templateMapfile> in <map> section for better control
-->
<highlightColor>0 255 255</highlightColor>


<!--
 Defines if SELECT function causes feature highlight
-->
<highlightSelected>1</highlightSelected>

<!--
 AUTOZOOM: zoom in automatically after results are displayed
 possible values: off  search  nquery (= select)
-->
<autoZoom>search</autoZoom>
<autoZoom>nquery</autoZoom> 

<!--
 Add button 'zoom to All Features' to result table
 - possible values: off  search  nquery (= select)
-->
<zoomAll>nquery</zoomAll>
<zoomAll>search</zoomAll>

<!--
 How to show the query results (identify/search) 
 dynwin: open DHTML window
 anything else will be used as id of the DOM elment where to place the query result
-->
<infoWin>dynwin</infoWin>

<!--
 Automatically align column contents of result tables of queries
 with regard to data type (default, numeric, currency, etc)
 algorithm in 'sorttable.js', function 'ts_alignCols(table)'
-->
<alignQueryResults>1</alignQueryResults>

<!--
 Extent buffer for zoom extent for point layers in queries
 value in map units
-->
<pointBuffer>10000</pointBuffer>

<!--
 Extent buffer for zoom extent for non-point layers in queries
 value in a fraction of the original extent
-->
<shapeQueryBuffer>0.02</shapeQueryBuffer> 

<!--
Self explainatory
-->
<numberFormat>
    <decimals>1</decimals>
    <decimalPoint>,</decimalPoint>
    <thousandsSep>||</thousandsSep> <!-- 2 pipes "||" are used for a blank as separator-->
</numberFormat>


<ui>

<!--
 Categories Style in TOC: 
 (only has effect when useCategories = 1) 
 - tree or flat
-->
<tocStyle>tree</tocStyle>

<!--
 Legend Style: 
 - attached: together with TOC
 - swap: swapping with TOC
-->
<legendStyle>attached</legendStyle>


<!--
 Use categories to thematically group layers 
 categories defined in incphp/custom.php
 works for TOC setting 'flat' and 'tree'
 1 = yes,  0 = no
-->
<useCategories>1</useCategories>

<!--
 use checkboxes for en/disable complete categories
 with child groups/layers. 1 = yes,  0 = no
-->
<catWithCheckbox>1</catWithCheckbox>

<!--
 Layer list (TOC) automatically updated according to scale
-->
<scaleLayers>1</scaleLayers>

<!--
 Icon Width in pixels
-->
<icoW>18</icoW>

<!--
 Icon Height in pixels
-->
<icoH>14</icoH>

<locale>

<!--
 Default language
-->
<defaultLanguage>en</defaultLanguage>

<!--
 Default character set
 UTF-8
-->
<defaultCharset>UTF-8</defaultCharset>

<!--
 if map file contains non-ASCII characters,eg for layer DESCRIPTION or CLASS names, 
 and is not in UTF (UNICODE) encoding set value to 1
-->
<map2unicode>1</map2unicode>

<print>

<!--
 PDF print resolution
 - Factor to increase resolution for better image quality 
-->
<pdfres>2</pdfres>

<!--
Print formats
-->
<printImgFormat>png</printImgFormat>
<printAltImgFormat>jpeg</printAltImgFormat>
            

<download>

<!--
DPI levels for map download
- used in downloaddlg.phtml
-->
<dpiLevels>150</dpiLevels>
<dpiLevels>200</dpiLevels>
<dpiLevels>300</dpiLevels>

<php>

<pearDbClass>MDB2</pearDbClass>

<pluginsConfig>

Plugin-specific config setiings. See README for every plugin how to define

<export>
    <formats>XLS</formats>
    <formats>CSV</formats>
    <formats>PDF</formats>
</export>

<tocdomains>
    <domain id="domain1"  description="First Domain" >
        <category>cat_admin</category>
        <category>cat_infra</category>
        <category>cat_nature</category>
    </domain>
    <domain id="domain2"  description="Second Domain" state="open">
        <category>cat_raster</category>
        <category>cat_osm</category>
        <category>cat_google</category>
    </domain>
</tocdomains>

<searchlist>

The search definitions can be either directly defined in this XML file: "inline" option

<config>
   <pm_search_configfile>inline</pm_search_configfile>
   ...
</config>

or in a separate file below the custom config directory: define relative file path to search.xml

<config>
   <pm_search_configfile>default/search.xml</pm_search_configfile>
   ...
</config>

See Search definition via XML file for more details.

Last modified 2 years ago Last modified on Jan 7, 2015, 7:54:53 PM