Bonjour à tous,
Je suis novice dans le domaine du SIG.
J'utilise Géoportail en tant que Openlayers accouplé à Mapfish.

Mon problème est le suivant, j'aimerais pouvoir afficher ma carte à l'échelle des rues. Actuellement, je suis à l'échelle des pays.

J'ai essayé de mettre comme IGNF : GeoportalFXX. Mais cela n'a pas fonctionné.

J'ai essayé de rajouter des couches, sans succès!

Voici mon code :

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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
 <script type="text/javascript">
    <!--
        // the viewer variable is declared by the API through the instance parameter

        // create namespace
        Ext.namespace('Geoportal');

        // create application
        Geoportal.app = function () {
            // private vars:
            var map, toolbarItems = [], viewport, vectorLayer;

            var epsg4326 = new OpenLayers.Projection("EPSG:4326");
            var miller = new OpenLayers.Projection("IGNF:MILLER");

            // private functions
            var createMap = function () {
                map = new OpenLayers.Map('viewerDiv', {
                    projection: "EPSG:4326",
                    resolutions: Geoportal.Catalogue.RESOLUTIONS.slice(0),
                    projection: miller,
                    maxExtent: new OpenLayers.Bounds(-180, -57, 180, 72).transform(epsg4326, miller, true),
                    units: miller.getUnits(),
                    controls: [
                    new OpenLayers.Control.ScaleLine(),
                    new OpenLayers.Control.MousePosition(),
                    new OpenLayers.Control.KeyboardDefaults(),
                    new OpenLayers.Control.Attribution(),
                    new Geoportal.Control.PermanentLogo(),
                    new Geoportal.Control.TermsOfService()
                ]
                });
            };

            var createGeoportalLayer = function () {
                var l0 = new Geoportal.Layer.WMSC(
                    OpenLayers.i18n('ORTHOIMAGERY.ORTHOPHOTOS'),
                    gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey]
                          .resources['ORTHOIMAGERY.ORTHOPHOTOS:WMSC'].url,
                    {
                        layers: 'ORTHOIMAGERY.ORTHOPHOTOS',
                        format: 'image/jpeg',
                        exceptions: "text/xml"
                    },
                    {
                        gridOrigin: new OpenLayers.LonLat(0, 0),
                        isBaseLayer: true,
                        resolutions: Geoportal.Catalogue.RESOLUTIONS.slice(0, 5),
                        alwaysInRange: true,
                        opacity: 0.8,
                        projection: miller,
                        maxExtent: new OpenLayers.Bounds(-180, -57, 180, 72).transform(epsg4326, miller, true),
                        units: miller.getUnits(),
                        attribution: 'provided by IGN',
                        GeoRM: Geoportal.GeoRMHandler.addKey(
                             gGEOPORTALRIGHTSMANAGEMENT.apiKey,
                             gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.url,
                             gGEOPORTALRIGHTSMANAGEMENT[gGEOPORTALRIGHTSMANAGEMENT.apiKey].tokenServer.ttl,
                             map)
                    }
                  );
                map.addLayer(l0);
            };


            var createVectorLayer = function () {
                vectorLayer = new OpenLayers.Layer.Vector("vector", {
                    displayInLayerSwitcher: true
                });
                map.addLayer(vectorLayer);

                return vectorLayer;
            };

            var addMapControls = function () {
                var navControl = new OpenLayers.Control.Navigation({
                    type: OpenLayers.Control.TYPE_TOGGLE,
                    zoomWheelEnabled: true
                });
                map.addControl(navControl);
                navControl.activate();
            };

            var createViewport = function () {
                viewport = new Ext.Viewport({
                    layout: 'border',
                    items: [
                    new Ext.BoxComponent({
                        region: 'north',
                        el: 'north',
                        height: 40,
                        margins: { left: 0, top: 0 }
                    }), {
                        region: 'west',
                        title: OpenLayers.i18n('gpControlLayerSwitcher.label'),
                        width: 200,
                        border: true,
                        margins: '5 0 0 5',
                        frame: false,
                        split: true,
                        layout: 'fit',
                        collapsible: true,
                        items: [{
                            xtype: 'layertree',
                            map: map,
                            border: false
                        }]
                    }, {
                        region: 'center',
                        layout: 'fit',
                        frame: false,
                        border: true,
                        margins: '5 5 0 0',
                        items: [{
                            xtype: 'mapcomponent',
                            map: map,
                            tbar: toolbarItems,
                            border: false
                        }]
                    }, new Ext.BoxComponent({
                        region: 'south',
                        el: 'south',
                        height: 40,
                        border: false

                    })
                ]
                });
            };

            var createToolbar = function () {
                var action;

                var createSeparator = function () {
                    toolbarItems.push(" ");
                    toolbarItems.push("-");
                    toolbarItems.push(" ");
                };

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.ZoomToMaxExtent(),
                    map: map,
                    iconCls: 'zoomfull',
                    toggleGroup: 'map',
                    tooltip: 'Zoom minimal'
                });

                toolbarItems.push(action);

                createSeparator();

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.ZoomBox(),
                    tooltip: 'Zoom supérieur',
                    map: map,
                    iconCls: 'zoomin',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.ZoomBox({
                        out: true
                    }),
                    tooltip: 'Zoom inférieur',
                    map: map,
                    iconCls: 'zoomout',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.DragPan({
                        isDefault: true
                    }),
                    tooltip: 'Déplacement',
                    map: map,
                    iconCls: 'pan',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);

                createSeparator();

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Point),
                    tooltip: 'Déssiner un cercle',
                    map: map,
                    iconCls: 'drawpoint',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);


                action = new GeoExt.Action({
                    control: new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Path),
                    tooltip: 'Déssiner une ligne sur la carte',
                    map: map,
                    iconCls: 'drawline',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);

                action = new GeoExt.Action({
                    control: new OpenLayers.Control.DrawFeature(vectorLayer, OpenLayers.Handler.Polygon),
                    tooltip: 'Déssiner un polygon sur la carte',
                    map: map,
                    iconCls: 'drawpolygon',
                    toggleGroup: 'map'
                });

                toolbarItems.push(action);

                createSeparator();

                action = new GeoExt.Action({
                    text: "navigate",
                    map: map,
                    control: new OpenLayers.Control.Navigation(),
                    toggleGroup: "editing"
                });
                toolbarItems.push(action);
                createSeparator();

           
                action = new GeoExt.Action({
                    text: "Switch",
                    map: map,
                    control: new OpenLayers.Control.LayerSwitcher(),
                    toggleGroup: "switch"
                });
                toolbarItems.push(action);

                createSeparator();

                // Bar de zoom
                action = new GeoExt.Action({
                    map: map,
                    control: new OpenLayers.Control.PanZoomBar()
                });
               
                
                // Affichage des graticules
                action = new GeoExt.Action({
                    map: map,
                    control: new OpenLayers.Control.Graticule()
                    
                });

                ctrl = new OpenLayers.Control.NavigationHistory();
                map.addControl(ctrl);

            };

            // public space:
            return {
                // for debug, we make this property public:
                vector: null,

                init: function () {
                    var language = OpenLayers.Lang.getCode();
                    var re = new RegExp("^" + language);
                    var slct = OpenLayers.Util.getElement('gpChooseLang');
                    slct.onchange = function () {
                        OpenLayers.Lang.setCode(this.options[this.selectedIndex].value);
                        OpenLayers.Util.getElement('Taittinger GeoPortail').innerHTML = OpenLayers.i18n('Taittinger GeoPortail');
                        OpenLayers.Util.getElement('example_explain').innerHTML = OpenLayers.i18n('example_explain');
                        OpenLayers.Util.getElement('legal').innerHTML = OpenLayers.i18n('legal');
                        this.blur();
                    };
                    for (var i = 0; i < slct.options.length; i++) {
                        if (slct.options[i].value.match(re)) {
                            slct.options[i].selected = true;
                        }
                    }

                    Ext.QuickTips.init();
                    createMap();
                    createGeoportalLayer();

                    this.vector = createVectorLayer();
                    // vector layer est accessible via Geoportal.app.vector
                    addMapControls();
                    createToolbar();
                    createViewport();

                    OpenLayers.Util.getElement('example_title').innerHTML = OpenLayers.i18n('Titre');
                    OpenLayers.Util.getElement('example_explain').innerHTML = OpenLayers.i18n('neXXtep-technologies');
                    OpenLayers.Util.getElement('legal').innerHTML = OpenLayers.i18n('legal');
                    map.setCenter(new OpenLayers.LonLat(4.02861, 49.2653).transform(epsg4326, miller), 4);
                }
            };
        } ();  // end of app

        Ext.onReady(Geoportal.app.init, Geoportal.app);

      -->
    </script>
Si vous connaissez un bon tuto pour mapfish et geoportail accouplé, je suis preneur.

Je vous remercie d'avance de votre aide.

Cordialement

K.