Building An Openlayers 3 Map Viewer With React: @pirminkalberer Sourcepole Ag, Switzerland
Building An Openlayers 3 Map Viewer With React: @pirminkalberer Sourcepole Ag, Switzerland
@PirminKalberer
Sourcepole AG, Switzerland
www.sourcepole.com
> https://github.com/pka/ol3-react-example
FOSS4G Seoul 17.9.15 OpenLayers 3 + React
The „JQuery way“
> http://facebook.github.io/react/
> The V in MVC
> Components, not templates
> Display logic and markup are thighly coupled
> Re-render, don't mutate the DOM
> Fast Virtual DOM
> Components are reusable, composable, unit
testable
> Concepts: https://youtu.be/x7cQ3mrcKaY
> JSX:
render () {
return (
<h1>Hello {this.props.name}!</h1>
);
> Javascript:
render () {
return React.createElement("div", null, "Hello ",
this.props.name);
}
> CommentBox
> CommentList
> Comment
> CommentForm
> Props
> Read-only attributes
> State
> State is set using the setState method.
Calling setState triggers UI updates.
> Re-render the whole app once the state
changes
> Unidirectional Data Flow
> Data is guaranteed up to date
> Virtual DOM: makes re-rendering on every
change fast
> HTML:
<body>
<div id="olmap"/>
<div id="reactcomponents"/>
</body>
> https://github.com/pka/ol3-react-example
@PirminKalberer
@sourcepole