Created
August 3, 2018 10:47
-
-
Save radzionc/4eefe32a4fa526b36ce41229c218d920 to your computer and use it in GitHub Desktop.
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
... | |
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