Skip to content

Commit

Permalink
Introduces WfsSearch
Browse files Browse the repository at this point in the history
  • Loading branch information
KaiVolland committed Apr 9, 2018
1 parent dd602b0 commit 8e12eb4
Show file tree
Hide file tree
Showing 4 changed files with 613 additions and 0 deletions.
66 changes: 66 additions & 0 deletions src/Field/WfsSearch/WfsSearch.example.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
This demonstrates the usage of the WfsSearch.

```jsx
const React = require('react');
const OlMap = require('ol/map').default;
const OlView = require('ol/view').default;
const OlLayerTile = require('ol/layer/tile').default;
const OlSourceOsm = require('ol/source/osm').default;
const OlProj = require('ol/proj').default;

class WfsSearchExample extends React.Component {

constructor(props) {

super(props);

this.mapDivId = `map-${Math.random()}`;

this.map = new OlMap({
layers: [
new OlLayerTile({
name: 'OSM',
source: new OlSourceOsm()
})
],
view: new OlView({
center: OlProj.fromLonLat([37.40570, 8.81566]),
zoom: 4
})
});
}

componentDidMount() {
this.map.setTarget(this.mapDivId);
}

render() {
return(
<div>
<div className="example-block">
<label>WFS Search:<br />
<WfsSearch
placeholder="Type a countryname in its own language…"
baseUrl='http://ows.terrestris.de/geoserver/osm/wfs'
featureTypes={['osm:osm-country-borders']}
searchAttributes={['name']}
map={this.map}
style={{
width: '80%'
}}
/>
</label>
</div>
<div
id={this.mapDivId}
style={{
height: '400px'
}}
/>
</div>
)
}
}

<WfsSearchExample />
```
Loading

0 comments on commit 8e12eb4

Please sign in to comment.