Created
May 14, 2019 16:27
-
-
Save BetterProgramming/305678f7839a19d34b5029a1c58a9386 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| import ReactMapboxGl, { Layer, Feature } from "react-mapbox-gl"; | |
| const Map = ReactMapboxGl({ | |
| accessToken: "pk.eyJ1IjoiZmFicmljOCIsImEiOiJjaWc5aTV1ZzUwMDJwdzJrb2w0dXRmc2d0In0.p6GGlfyV-WksaDV_KdN27A" | |
| }); | |
| // in render() | |
| <Map | |
| style="mapbox://styles/mapbox/streets-v9" | |
| containerStyle={{ | |
| height: "100vh", | |
| width: "100vw" | |
| }} | |
| > | |
| <Layer | |
| type="symbol" | |
| id="marker" | |
| layout={{ "icon-image": "marker-15" }} | |
| > | |
| <Feature coordinates={[-0.481747846041145, 51.3233379650232]}/> | |
| </Layer> | |
| </Map> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment