Skip to content

Instantly share code, notes, and snippets.

@radzionc
Created August 3, 2018 10:47
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radzionc/4eefe32a4fa526b36ce41229c218d920 to your computer and use it in GitHub Desktop.
Save radzionc/4eefe32a4fa526b36ce41229c218d920 to your computer and use it in GitHub Desktop.
...
render() {
const {
pageWidth,
pageHeight,
zoom,
latitude,
longitude,
updateMap,
updateProjections,
cityGeoJson,
inFly
} = this.props
const mapProps = {
...MAP_OPTIONS,
width: pageWidth,
height: pageHeight,
zoom,
latitude,
longitude,
onViewportChange: updateMap
}
return (
<ReactMapGL {...mapProps} ref="reactMap">
{cityGeoJson && !inFly &&
<SVGOverlay
redraw={this.redraw}
updateProjections={updateProjections}
/>
}
</ReactMapGL>
)
}
...
redraw = ({ project, unproject }) => {
...
return (
<g>
{
rects.map(({ points }, index) => (
<Rectangle key={'rectangle' + index} points={points}/>
))
}
{
cells.map(({ points }, index) => (
<Cell key={'cell' + index} points={points} />
))
}
{
specialCell && <SpecialCell key={'specialCell'} points={specialCell.points}/>
}
{
places.map(({ x, y }, index) => (
<Place key={'place' + index} x={x} y={y} />
))
}
{
contoursPoints.map((points, index) => (
<Contour
key={'contour' + index}
points={points}
/>
))
}
</g>
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment