Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created May 14, 2019 16:27
Show Gist options
  • Select an option

  • Save BetterProgramming/305678f7839a19d34b5029a1c58a9386 to your computer and use it in GitHub Desktop.

Select an option

Save BetterProgramming/305678f7839a19d34b5029a1c58a9386 to your computer and use it in GitHub Desktop.
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