-
Notifications
You must be signed in to change notification settings - Fork 890
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* MapPane implements Leaflet panes. * Added MapPane to index.js * Helper function 'getInstanceOptions' to pass options + possible pane from context. * Implemented possible pane context into appropriate items. * Added MapPane to docs and examples. * Added to docs/API * Typo fix * Typo fix * Initial commit for MapPane component. * Allow overriding pane name through props. * Allow nested panes. * Renamed 'MapPane' to 'Pane' * Renamed 'getInstanceOptions' to 'getOptions' * Renamed MapPane.js to Pane.js * Removed paneType * Renamed MapPane to Pane in documentation and examples. * Removed _isMounted, Moved this._name to this.state.name * Bugfix missing 'PropTypes' * componentWillMount moved to componentDidMount * Removed paneType export from types/index * Added Pane export in index to alphabetical order. * Updated docs and example. * Comments, className, removed zIndex. * Updated pane docs and example. * Removed deprecated lines in createPane. * Disallow default pane names. * Updated docs * Removed 'cloneElement' for children, Bugfix removing pane.
- Loading branch information
Showing
22 changed files
with
329 additions
and
15 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
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,61 @@ | ||
import React, { Component } from 'react' | ||
import { Pane, TileLayer, Rectangle } from '../../src' | ||
|
||
const outer = [ | ||
[50.505, -29.09], | ||
[52.505, 29.09], | ||
] | ||
const inner = [ | ||
[49.505, -2.09], | ||
[53.505, 2.09], | ||
] | ||
|
||
export default class PaneExample extends Component { | ||
state = { | ||
bounds: outer, | ||
} | ||
|
||
onClickInner = () => { | ||
this.setState({bounds: inner}) | ||
} | ||
|
||
onClickOuter = () => { | ||
this.setState({bounds: outer}) | ||
} | ||
|
||
render () { | ||
return ( | ||
<Map bounds={this.state.bounds}> | ||
<TileLayer | ||
attribution='© <a href="http://osm.org/copyright">OpenStreetMap</a> contributors' | ||
url='http://{s}.tile.osm.org/{z}/{x}/{y}.png' | ||
/> | ||
<Pane name='cyan-rectangle' style={{ | ||
zIndex: 500, | ||
}}> | ||
<Rectangle | ||
bounds={outer} | ||
color={'Cyan'} | ||
/> | ||
</Pane> | ||
|
||
<Pane name='yellow-rectangle' style={{ | ||
zIndex: 499, | ||
}}> | ||
<Rectangle | ||
bounds={inner} | ||
color={'Yellow'} | ||
/> | ||
|
||
{/* Nested Pane */} | ||
<Pane name='purple-rectangle' className={'purplePane-purplePane'}> | ||
<Rectangle | ||
bounds={outer} | ||
color={'Purple'} | ||
/> | ||
</Pane> | ||
</Pane> | ||
</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
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
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
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
Oops, something went wrong.