Saturday, March 28, 2009

Print Settings

common/print.xml

also check templates/print.css

PDF Print Options

PDF Print Settings: Including title, font, header height/color, and logo
php_config.php

Other Print settings in common\print.xml

Wednesday, March 11, 2009

Extended Metadata on Right Click on Layer

Details are in Available Plugins documentation:

Informations about groups / layers
Display informations for each group or layer from the mapfile. For instance, if you use grpInfoLink with value 1 or 2 in your
configuration file, when clicking on a group name or on the associated icon, a dynamic window will appear and display the
long description about this group.
Activation
To activate this plugin, simply add "infos" in your plugin list. If you don't specify the infosMetadata in your configuration file,
the MATADATA fiel named DESCRIPTION will be used.
Customize your informations
Simply specify infosMetadata = "MY_LONG_DESCRIPTION" to use the METADATA field named
MY_LONG_DESCRIPTION for instance.

Scale bar, Slider, MapTool Area attributes

Position, size etc comes form layout.css.

Saturday, March 7, 2009

Pop-up Window Sizes

pmapper.js

Dynwin popup size is controlled from dialog.css -> div.jqmDialog

Sunday, March 1, 2009

Redraw Legend Patches

The legends will be redrawn when the .map file is changed. If using INCLUDEs, it doesn't get updated regularly so delete file images\legend\createimg.log

Saturday, February 28, 2009

A Dbase is empty errror

Check Projection and check that you really have uploaded the latest projected file. Make sure you have uploaded the correct file if you have added fields.

If a layer is in TOC but doesn't appear on Map

Check Projection

Blank Page when Refreshing

If no source text, then there is probably something wrong with php_config.php

Friday, February 20, 2009

Legend Order

When a class category is "All others" , add that to the bottom of the class list, otherwise everything appears to go into that class.

Wednesday, February 18, 2009

Query results rendered into PDF ¶

The plugins directory has a folder "export" (development version see here) that allows export of query results to PDF, Excel and CSV.

Setting up a common library container for multiple p.mapper application

p.mapper currently requires to have all PHP and Javascript files inside the main application window. For multiple applications using the same PHP and JS code base this requires a multiple maintenance of these files. Most p.mapper applications differ just in the configuration (config.ini, map file, etc) and the CSS templates, so having them sharing the same libaries makes the maintenance of these applications easier, mainly for applying updates and bug fixes.

One way to work with this is the use of symbolic links. One could e.g. set up in the WWW root a common directory pmapper containing the javascript and incphp directories and symlinking them into the applications' tree. Like the following example

+ pmapper
+ incphp
+ javascript

+ application_1
+ incphp->../pmapper/incphp
+ javascript->../pmapper/javascript
+ application_2
+ incphp->../pmapper/incphp
+ javascript->../pmapper/javascript

While working with symlinks is something typical under UNIX, Windows does not seem to provide this functionality. But in fact, it does, just not well documented. See eg. this article how to work with 'junctions', the equivalent of symlinks under Windows.

Remove temporary files from /tmp directory

p.mapper creates various temporary files under the directory specified in the map file at WEB - IMAGEPATH

to remove them automatically add a shell script file rm_tempfiles under /etc/cron.daily that contains the following lines:

#!/bin/sh
find /home/www/tmp -name "*.png" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.jp*" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.tif" -amin +60 -exec rm -f {} \;
find /home/www/tmp -name "*.zip" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.tar" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.tmp" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.pdf" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "*.xls" -amin +300 -exec rm -f {} \;
find /home/www/tmp -name "sess_*" -amin +300 -exec rm -f {} \;

and set the file executable

~# chmod 755 rm_tempfiles

Default layers must be visible on map but not in legend/TOC

Default layers visible on map but not in legend/TOC ¶

If a layer should always be visible on the map but not selectable/visible in legend or TOC (e.g. copyright, north arrow, background image layer) the easiest solution is to define for the layer in the map file

STATUS DEFAULT

and don't reference the layer in the config.ini file. This way it is always drawn by Mapserver logic and never switched off by p.mapper logic.

Debugging Hints

http://svn.pmapper.net/trac/wiki/FaqDebugging

Plugins

http://svn.pmapper.net/trac/wiki/AvailablePlugins

Query Definitions

search.xml

Hyperlinks

n order to make the results of queries more flexible the application offers the possibility of hyperlinks for selected fields. This works both for layer fields and fields out of a joined DB table. The hyperlinks are defined in the METADATA tag for every layer like the following example:

"RESULT_HYPERLINK" "FIELD1||Link on Detail, FIELD2"

In between the quotes separate the hyperlink fields with commas. If you don't want to have the field value being displayed as the hyperlink text, you can add an ALIAS name after the field name separated with a double pipe sign like set for FIELD1 in the example above.

The hyperlink definition has its corresponding JavaScript function openHyperlink() (in the custom.js file) that is added to every link as the action. The function receives layer, field name, and field value. For every layer and field you can define how to process this information, e.g. include them in other JavaScript functions.

Tolerance for Queries

The query function of p.mapper uses the TOLERANCE settings in the map file. This means you should define tolerances in the map file for each layer you want to be queryable. Recommended are TOLERANCEUNITS pixels and settings for TOLERANCE between 2 and 5 for vector layers, and 0 for raster layers.

Context Menus

js_config.php

Measurement Units

js_config.php

Zoom Layout

js_config.php

Auto-Identify and Search Results

Table or Tree js_config.php

Scale Selection Values

js_config.php

Page DIV sizes and visibility

js_config.php

Page Title and Print Headings

php_config.php

Plugins

config_default.ini

Zoom Slider

config_default.ini

Image Formats

config_default.ini

Legend Settings & TOC Settings

config_default.ini

Search Settings

config_default.ini

Auto-Identify Groups

config_default.ini

Layers Visible on Startup

defGroups in config_default.ini

Naming Conventions

It is recommended to avoid spaces in group or layer names.

Resolution for PDF

In order to allow correct PDF printing and to have correct scales for printing set RESOLUTION tag below MAP to 96 in config_default.ini.

Page Layout

map.phtml

Categories for TOC

Set up in php_config.php

Toolbars

Set up in php_config.php

Error Logging

Set up error_log to valid file name in php.ini and set debugLevel to 3 in config_default.ini

LAYER METADATA

The LAYER METADATA, RESULTS_FIELD and RESULTS_HEADER provide the information that appears in the Identify box (and probably the Search box).

Tuesday, February 17, 2009

Item to appear in Legend

A layer's CLASS must have a have a NAME for the symbology to appear correctly in the legend. If the layer has a single symbology, making the NAME a space result in it showing correctly in the legend.

Identify Icon Results

Each layer must have a TEMPLATE 'void' (or other template if it exits) attribute.

Followers