>> Back to available plugins page

Plugins concerning Table Of Content (TOC) and legend

addbuttonstogroups

Description

Add buttons for each groups / layer in TOC.

How to use

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>addbuttonstogroups</plugins>
....
        </pmapper>
    </ini>
</pmapper>

Set plugin configuration by adding in config_XXXXX.xml file:

</pmapper>
    </ini>
...
        </pluginsConfig>
...
            <addbuttonstogroups>
                <abtgList>info|PM.Custom.showGroupInfo|Layer Info|images/infolink.gif,zoom|PM.Map.zoom2group|Zoom To Layer|images/zoomtiny.gif</abtgList>
            </addbuttonstogroups>
        </pluginsConfig>
    </ini>
</pmapper>

"abtgList" : specify the buttons to add. For instance, with 'info|PM.Custom.showGroupInfo|Layer Info|images/infolink.gif,zoom|zoom2group|Zoom To Layer|images/zoomtiny.gif', the group with the following HTML code:

<span class="vis" id="spxg_countries">
  <span class="grp-title vis">Countries</span>
</span>

will become :

<span class="vis" id="spxg_countries">
  <span class="grp-title vis">Countries</span>
</span>
&nbsp;<a href="javascript:PM.Custom.showGroupInfo('countries')"
    title="Layer Info"><img alt="Layer Info" src="images/infolink.gif"></a>
&nbsp;<a href="javascript:zoom2group('countries')"
    title="Zoom To Layer"><img alt="Zoom To Layer" src="images/zoomtiny.gif"></a>

infos

Documentation is too old!!! Soon merge with layerinfo?

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.

You can use HTML syntax in this field : For example, by adding the following code in the METADATA of the layer named "Cities" in the pmapper_demo.map :

        "MY_LONG_DESCRIPTION" "<p>This layer show european cities.</p>
        <table width='98%' cellspacing='0' cellpadding='0' class='legtab'>
                <tbody>
                        <tr>                    
                                <td style='width: 18px;'>
                                        <img width='18' height='14' src='images/legend/cities10000eu_i0.png' alt='legend' style='width: 18px; height: 14px;'/>
                                </td>
                                <td><span id='spxg_cities10000eu00' class='vis'>> 1'000'000</span></td>
                        </tr>
                        <tr>                    
                                <td style='width: 18px;'><img width='18' height='14' src='images/legend/cities10000eu_i1.png' alt='legend'/></td>
                                <td><span id='spxg_cities10000eu01' class='vis'>500'000 - 1'000'000</span></td>         
                        </tr>
                        <tr>    
                                <td style='width: 18px;'><img width='18' height='14' src='images/legend/cities10000eu_i2.png' alt='legend'/></td>
                                <td><span id='spxg_cities10000eu02' class='vis'>100'000 - 500'000</span></td>
                        </tr>
                        <tr>
                                <td style='width: 18px;'><img width='18' height='14' src='images/legend/cities10000eu_i3.png' alt='legend'/></td>
                                <td><span id='spxg_cities10000eu03' class='vis'>50'000 - 100'000</span></td>
                        </tr>
                        <tr>
                                <td colspan='2'><span>...</span></td>
                        </tr>
                </tbody>
        </table>
        <br />....."

you will automatically obtain : plugin_infos_output.png

Config.ini example

;==============================================================
; Plugin infos options :
;--------------------------------------------------------------
; "infosMetadata" :
; specify the METADATA value to read for each layer.
; If not specified, the value of METADATA DESCRIPTION in the mapfile is used.
;--------------------------------------------------------------
infosMetadata = "MY_LONG_DESCRIPTION"

Layer info

Description

Replaces the default group information function from context menu with specific one.

How to use

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>layerinfo</plugins>
....
        </pmapper>
    </ini>
</pmapper>

Add a file ("layerinfo.xml" for instance) to your config directory and adapt it for your datasets. Contents can be any XHTML-compliant code.

Configure the plugin by adding in config_XXXXX.xml file:

<pmapper>
    <ini>
....
        <pluginsConfig>
....
            <layerinfo>
                <configfile>dev/layerinfo.xml</configfile> <!-- path to your config file -->
            </layerinfo>
....
        </pluginsConfig>
    </ini>
</pmapper>

Legend only

Description

It just hide TOC in order to show only the legend (and force "legendStyle" in swap mode).

How to use

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>legendonly</plugins>
....
        </pmapper>
    </ini>
</pmapper>

Size up and Down Object

Description

Increase or decrease object size using context menu on group/category tree.

How to use

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>sizeUpDownObj</plugins>
....
        </pmapper>
    </ini>
</pmapper>

Add the tools to context menu in /config/XXXXX/js_config.php file:

PM.contextMenuList = [     
    // layers/group in TOC
    {bindto: 'li.tocgrp',        
     menuid: 'cmenu_tocgroup',
     menulist: [   
...
        {id:'sizeUpDownObj-upObj', imgsrc:'sizeUpDownObj_upObj-b.png', text:'sizeUpDownObj__size_up', run:'PM.Plugin.SizeUpDownObj.cmSizeUpObj'},
        {id:'ssizeUpDownObj-downObj', imgsrc:'sizeUpDownObj_downObj-b.png', text:'sizeUpDownObj__size_down', run:'PM.Plugin.SizeUpDownObj.cmSizeDownObj'},
        {id:'sizeUpDownObj-resetObj', imgsrc:'sizeUpDownObj_resetObj-b.png', text:'sizeUpDownObj__size_reset', run:'PM.Plugin.SizeUpDownObj.cmResetSizeObj'},
        {id:'sizeUpDownObj-resetAll', imgsrc:'sizeUpDownObj_resetAll-b.png', text:'sizeUpDownObj__size_resetall', run:'PM.Plugin.SizeUpDownObj.cmResetSizeAllObj'},
...
        ], 
     styles: {menuStyle: {width:'auto'}}
    },
...
];

Set default plugin configuration by adding a line in config_XXXXX.xml file:

</pmapper>
    </ini>
...
        </pluginsConfig>
...
            <sizeUpDownObj>
                <!-- factor to increase or decrease size (default 1.33) -->
                <factor>1.33</factor>
                <!-- max increase or decrease iterations (default values: 4) -->
                <!-- newsizemax = size * abs(max * factor)-->
                <!-- newsizemin = size / abs(min * factor)-->
                <max>4</max>
                <min>4</min>
                <!-- apply to labels too ? 0 or 1 (default 0) -->
                <doLabels>0</doLabels>
                <!-- do not decrease label size down to the following value -->
                <!-- -1 = do not use this functionnality -->
                <labelminsize>10</labelminsize>
            </sizeUpDownObj>
...
        </pluginsConfig>
    </ini>
</pmapper>

Add the appropriate images from plugins/sizeUpDownObj/install/images/ to images/menus.

Add default translation from plugins/sizeUpDownObj/install/language_en-part.php to incphp/locale/language_en.php. You can add translations for other language (French is provided) by doing the same.


Themes and views

Description

This plugin can extend the layers selection.

Few definitions:

  • a theme is a list of layer to select, possibly with opacity.
  • a view is a theme but with extent.

What does this plugins can do?

  • auto insert a selectbox to chose a theme
  • auto insert a selectbox to chose a view
  • use a button tool to show theme box in "mapToolArea"
  • use a button tool to show view box in "mapToolArea"
  • if you don't display TOC but only legend, the layer management behavior become very simple (but with less functionalities !) for GIS beginner

Complementary plugin : ThemesAndViewsAdmin? plugin (maybe soon available...)

How to use

Configuration

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>themesandviews</plugins>
....
        </pmapper>
    </ini>
</pmapper>

Set plugin configuration by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
....
        <pluginsConfig>
....
            <themesandviews>
                <file>common/themesAndViews.xml</file>
                <defaultType>none</defaultType>
                <defaultCodeValue></defaultCodeValue>
                <themes>
                    <insertBoxType>first</insertBoxType> 
                    <boxContainer>.map-top-bar</boxContainer> 
                    <initAfterTOC>0</initAfterTOC> 
                    <selBoxStr>&lt;div id='selThemeBox' class='tavSelectBox' /&gt;</selBoxStr>
                    <keepSelected>0</keepSelected>
                </themes>
                <views>
                    <insertBoxType>last</insertBoxType> 
                    <boxContainer>.map-top-bar</boxContainer> 
                    <initAfterTOC>0</initAfterTOC> 
                    <selBoxStr>&lt;div id='selViewBox' class='tavSelectBox' /&gt;</selBoxStr>
                    <keepSelected>0</keepSelected>
                </views>
            </themesandviews>   
....
        </pluginsConfig>
    </ini>
</pmapper>

Common parameters for themes and views:

  • file: file that will define the themes and views
  • defaultType: what to automatically apply at startup. Possible values: none, theme, view
  • defaultCodeValue: empty or name of a theme or view to load at startup (depends on defaultType)

Parameters that can be different for themes and views:

  • insertBoxType: user (user defined in layout), first (= at first position in the specifyed container), last (= at the end of the specified container)
  • boxContainer: jQuery selector for box container
  • initAfterTOC: 0=before or 1=after
  • selBoxStr: HTML code for container
  • keepSelected: 0 (the box will not keep selected value) or 1 (keep selected value)

(optional) Add the themesandviews tool buttons to the interface in /config/XXXXX/js_config.php file:

PM.buttonsDefault = {
.....
    buttons: [
.....
		{tool:'themesbox',		name:'themesbox'},
		{tool:'viewsbox',		name:'viewsbox'},
.....
	]
}

Integration

Add default translation from plugins/themesandviews /install/language_en-part.php to incphp/locale/language_en.php. You can add translations for other language (French is provided) by doing the same.

(optional) Add styles. For instance with pmapper default layout and plugin default configuration:

  • in a CSS file:
    .tavSelectBox {
        float: left;
        padding-right: 50px;
    }
    
  • or replace in your configuration file "class='tavSelectBox'" with "class='tavSelectBox' style='float:right; padding-right:50px;'".

(optional) Add the appropriate icons for the buttons from plugins/themesandviews/install/images/buttons/default to images/buttons/default (or the corresponding theme directory).

Themes and views file content

Example provided in plugins/themesandviews/install/themesAndViews.xml

<?xml version="1.0" standalone="yes"?>
<themesorviews>
        <themeorview>
                <type>Theme</type>
                <name>theme1</name>
                <description>Vector data</description>
                <layers>
                        <layer>
                                <name>countries</name>
                                <opacity>95</opacity>
                        </layer>
                        <layer>
                                <name>cities10000eu</name>
                                <opacity>map</opacity>
                        </layer>
                        <layer>
                                <name>rivers</name>
                                <opacity>map</opacity>
                        </layer>
                </layers>
                <extent/>
        </themeorview>
        <themeorview>
                <type>Theme</type>
                <name>theme2</name>
                <description>All</description>
                <layers>
                        <layer>
                                <name>dem</name>
                                <opacity>map</opacity>
                        </layer>
                        <layer>
                                <name>jpl_wms_global_mosaic</name>
                                <opacity>map</opacity>
                        </layer>
                        <layer>
                                <name>countries</name>
                                <opacity>75</opacity>
                        </layer>
                        <layer>
                                <name>cities10000eu</name>
                                <opacity>map</opacity>
                        </layer>
                        <layer>
                                <name>rivers</name>
                                <opacity>map</opacity>
                        </layer>
                </layers>
                <extent/>
        </themeorview>
</themesorviews>

Description

Adds info link image for info about layer/group.

How to use

Enable the plugin by adding a line in config_XXXXX.xml file:

<pmapper>
    <ini>
        <pmapper>
....
            <plugins>tocinfolink</plugins>
....
        </pmapper>
    </ini>
</pmapper>

By default all groups/layers will get an info link inserted BEFORE the layer name. To change default behavior define an entry in js_config.php in your config directory:

Create an entry in

PM.Plugin.TocInfolink.options = {
    groupList: ['countries', 'cities10000eu'],   // list of layers/groups
    insert: 'after',                             // where to insert
    linkimg: 'images/infolink.gif'               // image used for link
};

Define the style for the image in a custom.css file under your config dir, like

.tocinfolink-img {
    padding: 1px 3px 2px 3px;
}

transparency

Not yet documented!!'''