-
Notifications
You must be signed in to change notification settings - Fork 889
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support WMSTileLayer dynamic parameters
- Loading branch information
Showing
9 changed files
with
106 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import React, { Component } from 'react' | ||
import { Map, TileLayer, WMSTileLayer } from '../../src' | ||
|
||
export default class WMSTileLayerExample extends Component { | ||
state = { | ||
lat: 51.505, | ||
lng: -0.09, | ||
zoom: 5, | ||
bluemarble: false, | ||
} | ||
|
||
onClick = () => { | ||
this.setState({ | ||
bluemarble: !this.state.bluemarble, | ||
}) | ||
} | ||
|
||
render () { | ||
return ( | ||
<Map | ||
center={[this.state.lat, this.state.lng]} | ||
zoom={this.state.zoom} | ||
onClick={this.onClick}> | ||
<TileLayer | ||
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' | ||
url='http://{s}.tile.osm.org/{z}/{x}/{y}.png' | ||
/> | ||
<WMSTileLayer | ||
layers={this.state.bluemarble ? 'nasa:bluemarble' : 'ne:ne'} | ||
url='http://demo.opengeo.org/geoserver/ows?' | ||
/> | ||
</Map> | ||
) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters