Bonjour,
(OL 8 et Mapserver 6.0)

- J'ai une vue `PostGIS` avec les données en `EPSG:2154`.
- Le fichier `MapServer` est utilisé pour rendre un WFS qui fonctionne bien avec `QGIS`.
- En suivant (https://openlayers.org/en/latest/exa...ector-wfs.html), j'essaie d'afficher le WFS dans `OpenLayers` avec la couche `OSM`en fond.

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
import { Map, View } from "ol"
        import TileLayer from "ol/layer/Tile"
        import OSM from "ol/source/OSM"
        import { register } from "ol/proj/proj4"
        import proj4 from "proj4"
        import GeoJSON from "ol/format/GeoJSON"
        import VectorSource from "ol/source/Vector"
        import VectorLayer from "ol/layer/Vector"
        import * as olExtent from "ol/extent"
        import { bbox as bboxStrategy } from "ol/loadingstrategy.js"
        ...
        proj4.defs(
       "EPSG:2154",
       "+proj=lcc +lat_1=49 +lat_2=44 +lat_0=46.5 +lon_0=3 +x_0=700000 +y_0=6600000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs")
        register(proj4)
        ...
        const prescriptionSource = new VectorSource({
         format: new GeoJSON(),
         url: function (extent) {
            return (
             "http://xxxx/cgi-bin/mapserv.exe?MAP=C:/ms4w/Apache/site/mapfile/vue_ol_prescription.map&" +
        "service=WFS&version=1.1.0&request=GetFeature&typename=prescription&" +
        "outputformat=application/json&SRSNAME=EPSG:2154&bbox=" +
         extent.join(",") +
        ",EPSG:3857"
        )
        },
        strategy: bboxStrategy,
       })

        const prescriptionCouche = new VectorLayer({
         source: prescriptionSource,
       })

       map.addLayer(prescriptionCouche)
Aucune donnée n'est affichée, juste une page HTML blanche et rien dans la console.

Dans la doc :
Use a FeatureUrlFunction to generate the url with other loading strategies. Requires format to be set as well
Une autre stratégie que `all` nécessite un paramètre `format` que je dois mal utiliser.
J'ai essayé avec:

````
dataProjection: "EPSG:2154",
featureProjection: "EPSG:3857"
````
comme option de new GeoJSON() sans résultat.

Enfin, je suis confus à ce sujet : Je ne sais pas quelle méthode utiliser et dans quel cas entre `loader` ou `url` dans une déclaration de source.