camptocamp / ngeo

Library combining OpenLayers and AngularJS
https://camptocamp.github.io/ngeo/master/examples
MIT License
135 stars 87 forks source link

WFS Permalink not working #1781

Closed marionb closed 8 years ago

marionb commented 8 years ago

Accessing WFS Permalinks as described in the spec https://github.com/camptocamp/c2cgeoportal/wiki/Spec-%231670-WFS-Permalink does not work.

An example used for testing (cinema in Interlaken): https://geomapfish-demo.camptocamp.net/2.1/theme/OSM?wfs_layer=cinema&wfs_osm_id=213230419

Tested link: http://camptocamp.github.io/ngeo/master/examples/contribs/gmf/apps/desktop?wfs_layer=fuel&wfs_osm_id=5702030

adube commented 8 years ago

(Note to self) I tried it in the apps and I got errors like:

AssertionError: Assertion failed: url is not set. to use the wfs permalink service,
set the value ngeoWfsPermalinkOptions

This might be the culprit.

adube commented 8 years ago

I was partially right. The missing url is one of the culprits. In reality, we're missing the whole configuration in the applications. If I look at the example, this is the configuration used:

app.module.value('ngeoWfsPermalinkOptions',
    /** @type {ngeox.WfsPermalinkOptions} */ ({
      url: 'https://geomapfish-demo.camptocamp.net/2.1/wsgi/mapserv_proxy',
      wfsTypes: [
        {featureType: 'fuel', label: 'display_name'},
        {featureType: 'osm_scale', label: 'display_name'}
      ],
      defaultFeatureNS: 'http://mapserver.gis.umn.edu/mapserver',
      defaultFeaturePrefix: 'feature'
    }));

I suppose the url, defaultFeatureNS and defaultFeaturePrefix are okay to use 'as-is' in the applications, but what about the wfsTypes?`

@sbrunner: I'll create a PR where the list of wfsTypes is the same as the example. If you want to have more defined, then please let me know what needs to be added.