Indice

mio_pmapper

Esempio di configurazione di pMapper.

Il file config/config_default.xml

Queste sono le modifiche rispetto al config_default.xml originale:

<map>
    <mapFile>mio_pmapper.map</mapFile>
    <categories>
        <category name="cat_nature">
            <group>curve_livello</group>
            <group>aree_idriche</group>
            <group>entita_lineari</group>
            <group>archi_ferroviari</group>
        </category>
    </categories>
    <allGroups>
        <group>curve_livello</group>
        <group>aree_idriche</group>
        <group>entita_lineari</group>
        <group>archi_ferroviari</group>
    </allGroups>
    <defGroups>
        <group>curve_livello</group>
    </defGroups>
    <imgFormat>aggpng24</imgFormat>
    <sliderMax>max</sliderMax>
    <sliderMin>2000</sliderMin>
</map>

config/default/js_config.php

Si modifica l'elenco delle scale preimpostate e si configura la rotellina del mouse in stile GoogleMaps:

PM.scaleSelectList = ["2 000", "5 000", "10 000", "25 000", "50 000", "100 000"];
PM.ZoomBox.wheelZoomGoogleStyle = true;

Il file config/default/mio_pmapper.map

MAP

  # C:\ms4w\apps\mio_pmapper\pmapper-4.0.beta3\config\default\mio_pmapper.map

  # Copyright (C) 2009 Niccolo Rigacci (niccolo@rigacci.org)
  # This file is licensed under the
  # Creative Commons Attribution-Share Alike 2.5 IT License.

  NAME "firenze10k"
  EXTENT 1680955 4846472 1687816 4852211
  SIZE 800 600
  SHAPEPATH "../../../../../Apache/htdocs/test1/gisdata"
  SYMBOLSET "../common/symbols/symbols-pmapper.sym"
  FONTSET "../common/fonts/msfontset.txt"
  IMAGETYPE aggpng24

OUTPUTFORMAT
  NAME "aggpng24"
  #DRIVER "GD/PNG"
  DRIVER "AGG/PNG"
  IMAGEMODE RGB
END

WEB
  TEMPLATE  "mio_pmapper.html"       # Template file, relative to mapfile.
  IMAGEPATH "/ms4w/tmp/ms_tmp/"     # Temporary files, must be inside DocumentRoot.
  IMAGEURL  "/ms_tmp/"              # Web path for IMAGEPATH directory.
  MINSCALE 5000
  MAXSCALE 100000
END

REFERENCE
  IMAGE "mio_pmapper.png"
  SIZE 200 200
  EXTENT 1682032 4847850 1685462 4851280
  STATUS ON
  MINBOXSIZE 10
  MAXBOXSIZE 200
  OUTLINECOLOR 192 0 0
  COLOR -1 -1 -1
END

LAYER
  NAME "curve_livello"
  STATUS DEFAULT
  TYPE LINE
  DATA "shape/geofesta2008/firenze10k/s_275040/275040cu"
  CLASS
    STYLE
      COLOR 212 164 96
      WIDTH 1
    END
  END
END

LAYER
  NAME "aree_idriche"
  STATUS DEFAULT
  TYPE POLYGON
  DATA "shape/geofesta2008/firenze10k/s_275040/275040ad"
  CLASS
    COLOR 64 168 252
    OUTLINECOLOR 0 0 243
  END
END

LAYER
  NAME "entita_lineari"
  STATUS DEFAULT
  TYPE LINE
  TEMPLATE "void"
  TOLERANCE 6
  DATA "shape/geofesta2008/firenze10k/s_275040/275040el"
  CLASS
    COLOR 120 120 120
  END
  METADATA
    DESCRIPTION    "Entità lineari"
    RESULT_FIELDS  "FOGLIO,CODICE,RECORD,TOPON,DIMENS,IDENTIF"
    RESULT_HEADERS "Foglio,Codice,Record,Toponimo,Dimensione,Identificativo"
  END
END

LAYER
  NAME "archi_ferroviari"
  STATUS DEFAULT
  TYPE LINE
  DATA "shape/geofesta2008/firenze10k/s_275040/275040af"
  CLASS
    STYLE
      COLOR 0 0 0
      WIDTH 2
    END
  END
END

END

File config/default/mio_pmapper.html

Il template .html serve in fase di debug del file .map.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
    Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 
<head>
<title>MapServer Web Map Browse</title>
</head>
 
<body>
<form name="mapserv" method="GET" action="/cgi-bin/mapserv">
 
    <!-- Hidden MapServer CGI variables -->
    <input type="hidden" name="map"      value="[map]">
    <input type="hidden" name="imgext"   value="[mapext]">
    <input type="hidden" name="imgxy"    value="[center]">
    <input type="hidden" name="zoom"     value="1">
    <input type="hidden" name="zoomsize" value="2">
    <input type="hidden" name="mode"     value="browse">
 
    <table>
    <tr><td>
    <!-- The interactive, dynamically created map -->
    <input type="image" name="img" src="[img]" border="1"><br>
    </td><td valign="top">
    <!-- Zoom controls -->
    <input type="radio" name="zoomdir" value="1"  [zoomdir_1_check]>Zoom In<br>
    <input type="radio" name="zoomdir" value="0"  [zoomdir_0_check]>Pan<br>
    <input type="radio" name="zoomdir" value="-1" [zoomdir_-1_check]>Zoom Out<br>
    </td></tr>
    </table>
    <small>Scala 1:[scale]</small>
 
</form>
</body>
</html>

Reference map images/mio_pmapper.png