Flexberry / Leaflet-WFST

OGC WFS-T client layer for Leaflet.
http://flexberry.github.io/Leaflet-WFST/
MIT License
151 stars 50 forks source link

Issue with Mapserver 6.4.1 WFS Service #20

Closed gallien-lbr closed 8 years ago

gallien-lbr commented 8 years ago

I encounter an issue using Leaflet-WFST with mapserver v 6.4.1 with leaflet in its latest version 1-dev. It works with default tasmania layer.. When setting my custom wfs, It seems to try to get my layer namespace but can't resolve it. "Uncaught TypeError: Cannot read property 'value' of undefined"

Here's what I tried I added the current instruction in my mapfile => "wfs_namespace_prefix" "ms" Tried to remove typeNS etc..

My code is as below :

 var com_wfs = new L.WFS({
                url: DYNMAP_WS,
                typeNS:  'ms',
                typeName: 'ms:communes_simp',
                crs: L.CRS.EPSG4326,
                geometryField: 'the_geom',
                style: 
                {
                  color: 'blue',
                  weight: 2
                } }, new L.Format.GeoJSON({crs: L.CRS.EPSG4326})).addTo(map);
kuzkok commented 8 years ago

As I know in mapserver default geometryField name is not 'the_geom', but 'msGEometry'. And also mapserver out of box not support GeoJSON output format, try it with GML

 var com_wfs = new L.WFS({
                url: DYNMAP_WS,
                typeNS:  'ms',
                typeName: 'communes_simp',
                crs: L.CRS.EPSG4326,
                geometryField: 'msGeometry',
                style: 
                {
                  color: 'blue',
                  weight: 2
                }
}).addTo(map);

and question about url, in mapserver demo it seems like http://demo.mapserver.org/cgi-bin/wfs

gallien-lbr commented 8 years ago

Thanks for your answer. I ended up using Geoserver, now Its fine.