Skip to content

Commit

Permalink
Merge pull request #3 from geodatagouv/tusbar/modernize
Browse files Browse the repository at this point in the history
Modernize wfs-client
  • Loading branch information
tusbar authored Oct 23, 2018
2 parents 3634ec5 + 976c29d commit 92b8258
Show file tree
Hide file tree
Showing 13 changed files with 3,545 additions and 1,630 deletions.
48 changes: 0 additions & 48 deletions .eslintrc.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
language: node_js
node_js:
- "0.10"
before_install: npm install -g grunt-cli
- 8
67 changes: 30 additions & 37 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ A very simple WFS client
* Version negociation
* Service identification in plain JavaScript / JSON
* List all feature types
* Based on [Q promises](https://github.com/kriskowal/q)

## Usage

Expand All @@ -29,57 +28,51 @@ var client = wfs('http://your-wfs-server.tld/wfs', options);
### Get service capabilities

```js
client.capabilities()
.done(function(capabilities) {
const capabilities = await client.capabilities()

// Service identification
console.log(capabilities.service);
// Service identification
console.log(capabilities.service)

// Feature types
console.log(capabilities.featureTypes);

})
.fail(function(err) {
console.trace(err);
});
// Feature types
console.log(capabilities.featureTypes)
```

#### Service identification example

```js
{
title: 'My WFS server title',
abstract: 'This WFS server is dedicated to environment data...',
keywords: [ 'Data', 'Water', 'Energy', 'France', 'Europa'],
serviceType: 'WFS',
serviceTypeVersion: '2.0.0',
fees: 'Free',
accessConstraints: 'None'
title: 'My WFS server title',
abstract: 'This WFS server is dedicated to environment data...',
keywords: [ 'Data', 'Water', 'Energy', 'France', 'Europa'],
serviceType: 'WFS',
serviceTypeVersion: '2.0.0',
fees: 'Free',
accessConstraints: 'None'
}
```

#### Feature types example

```js
[
{
name: 'orgA:wind_power_zones',
title: 'Wind power zones',
keywords: [
'Wind power',
'Energy',
'Zoning'
]
},
{
name: 'orgB:solar_energy_zones',
title: 'Solar energy zones',
keywords: [
'Solar energy',
'Energy',
'Zoning'
]
}
{
name: 'orgA:wind_power_zones',
title: 'Wind power zones',
keywords: [
'Wind power',
'Energy',
'Zoning'
]
},
{
name: 'orgB:solar_energy_zones',
title: 'Solar energy zones',
keywords: [
'Solar energy',
'Energy',
'Zoning'
]
}
]
```

Expand Down
8 changes: 3 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,16 @@
/*
** Module dependencies
*/
const Client = require('./lib/client');

const Client = require('./lib/client')

/*
** Methods
*/
function wfs(url, options) {
return new Client(url, options);
return new Client(url, options)
}


/*
** Exports
*/
module.exports = wfs;
module.exports = wfs
Loading

0 comments on commit 92b8258

Please sign in to comment.