bonjour,

J'utilise un .map et un template associé pour rendre une carte web dynamique.
S j'arrive à generer une image et sa mise en forme associée, il m'est impossible de rendre la carte dynamique.
Zoom in, zoom out, activer/desactiver une couche ne fonctionnent pas.
Impossible de savoir pourquoi malgré la doc http://mapserver.org/fr/tutorial/sec...html#variables
ou encore un post comme celui-ci tres clair avec ses 2 fichiers, http://gis.stackexchange.com/questio...gi-application j'ai exactement les mêmes ! comprends pas...:mad:
quelquechose m'echappe clairement...:confused:
Si je pouvais beneficier de vos lumières...
Merci
mapfile :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
MAP    NAME fouille
    IMAGETYPE PNG
    RESOLUTION 72
    IMAGECOLOR 255 255 255
    TRANSPARENT false
    STATUS ON
    SIZE 600 450
    #EXTENT 516342.38 6662881.17 516588.29 6663152.47 sans layer forgeais
    EXTENT 516247 6662855 516964 6663577
    #EXTENT 443861 6599814 676261 6776506 
    UNITS METERS
    SHAPEPATH "./shapefiles" 
    DEBUG 5
    CONFIG "CPL_DEBUG" "ON"
    CONFIG "PROJ_DEBUG" "ON"
    CONFIG MS_ERRORFILE "C:/OSGeo4W/errorMapFile.txt"
    FONTSET "./fonts/fonts.txt"
    TEMPLATEPATTERN "template"
    
    WEB
        TEMPLATE "template.html" #&mode=map shunte le template (?)
        IMAGEPATH "C:/OSGeo4W/apache/htdocs/output/"
        IMAGEURL  "/output/"
        HEADER "query_header.html"
        FOOTER "query_footer.html"
        
        METADATA #obligé sinon marche pas
          'wms_title'           'Parcel Map'
          'wms_srs'             'EPSG:2154'
          'ows_encoding'        'UTF-8'
          'ows_abstract'        'Service WMS/WFS'
          "ows_enable_request"    "*"
        END #metadata
    END #end web
    PROJECTION # proj de sortie
        "init=epsg:2154"
    END
    
    SCALEBAR
    IMAGECOLOR 255 255 255
    SIZE 150 5
    INTERVALS 1
    STYLE 1
    UNITS kilometers
    STATUS EMBED
    POSITION LR
    end #end echelle
    
    LAYER
    NAME fond_de_carte
    TYPE RASTER
    STATUS ON
    CONNECTION "http://129.206.228.72/cached/osm/service?"
    CONNECTIONTYPE WMS
        PROJECTION
        "init=epsg:4326"
        END #end projection
    METADATA
   "wms_srs"             "EPSG:4326"
   "wms_name"            "osm_auto:all"
   "wms_server_version"  "1.1.1"
   "wms_format"          "image/jpeg"
   
    END #end layer
    
    
    #PERROU COMMENCE ICI
        
    LAYER
        NAME MP_emprise
        DATA MaillePerrouEmp
        STATUS DEFAULT #si pas de statut, alors on peut specifier &layer=xxxx qu'on veut afficher
        #dans l'adresse web du navigateur qui renvoie l'image generée :
        #http://localhost/cgi-bin/mapserv.exe?map=C:\OSGeo4W\apache\htdocs\test.map&layer=xxxx&mode=map        
        TYPE POLYGON  
        CLASS
            NAME "emp_color"
            STYLE
                COLOR 255 215 215
            END #end Style
        END #end class
    END #END layer
    
    LAYER
        Name faits
        DATA MaillePerrou_Faits
        STATUS DEFAULT
        TYPE LINE
        LABELITEM "NumFait"
        CLASS
            NAME "f_color"
            STYLE
                COLOR 0 0 0
            END # end style
            LABEL
                COLOR 132 50 50
                TYPE TRUETYPE
                FONT sans
                SIZE 4
                ANTIALIAS TRUE
                POSITION auto
                PARTIALS FALSE
                MINDISTANCE 300
                BUFFER 2
            END # end label
        END #end CLASS        
    END #end layer
    
    # Forgeais commence ici
    
LAYER
        NAME forgeais
        DATA MailleForgeaisEmp
        STATUS DEFAULT
        TYPE POLYGON
        LABELITEM LieuDit
        CLASS
            NAME "emp_color"
            STYLE
                COLOR 255 215 215
            END #end Style
            LABEL
                COLOR 132 50 50
                TYPE TRUETYPE
                FONT sans
                SIZE 8
                ANTIALIAS TRUE
                POSITION auto
                PARTIALS FALSE
                MINDISTANCE 100
                BUFFER 2
            end #end label
        end #end class    
    end #end layer
 
END #end of mapfile
template :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<!-- MapServer Template --><html>
<head><title>Simple Mapserver Template HTML Document</title></head>
<body bgcolor=#AAAAAA>
<h2>The image below was illustrated based on the instructions sent in the mapfile.</h2>
<!-- When using Mapserver with a template, the Mapserver application looks for the [img] tag within the template document to place the map -->


<!-- START OF MAPSERVER FORM -->
        <form name="mapserv" method="GET" action="C:\OSGeo4W\bin\mapserv.exe">
          
<!-- 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="[zoom]" />
          <input type="hidden" name="mode" value="browse" />


          <!--<div align="center"> -->
        <table width="600" border="0" align="center">
          <tr>
            <td>
                <table width="600" border="1">
                
            <tr>
        <td colspan="3">Select Layers:
<!-- SPECIFY VECTOR LAYERS -->
          <input type="checkbox" name="layer" value="fond_de_carte"
          [states_check]> fond&nbsp;
          <input type="checkbox" name="layer" value="MP_emprise"
          [hydro_check]>emprise &nbsp;
          </tr>
            
          <tr>
           <td>
<!-- SPECIFY MAP MODE -->
          <div align="center">Map Mode:<br>
        <select name="mode">
          <option value="browse" [browse_select]>Browse</option>
        </select>
          </div>
        </td>                
                
<!-- FORM SUBMIT BUTTON -->
            <td>
          <div align="center">
        <input type="submit" name="submit" value="Refresh">
          </div>
            </td>
    <!-- Zoom pan controls -->
            <td>
            <div align="center">Map Control: <br>
        <select name="zoom">
          <option value="4" [zoom_4_select]>Zoom In 4x</option>
          <option value="3" [zoom_3_select]>Zoom In 3x</option>
          <option value="2" [zoom_2_select]>Zoom In 2x</option>
          <option value="1" [zoom_1_select]>Recenter</option>
          <option value="-2" [zoom_-2_select]>Zoom Out 2x</option>
          <option value="-3" [zoom_-3_select]>Zoom Out 3x</option>
          <option value="-4" [zoom_-4_select]>Zoom Out 4x</option>
        </select>
          </div>
            </td>
        </tr>
            
        <tr>
                  <!-- THE INTERACTIVE, DYNAMICALLY CREATED MAP -->
            <td>     
                  <input type="image" name="img" src="[img]" width="600" height="450">
                  <br>
                    <!-- The scale bar-->
                    <img src="[scalebar]" alt="Scale Bar">
            </td>
        </tr>
            </table>
            </td>
          </tr>
         </table>
         <!--</div> -->
        </form>
</body>
</html>