Skip to content

Instantly share code, notes, and snippets.

@duanebester
Last active December 2, 2019 19:37
Show Gist options
  • Save duanebester/92a6551147c91e31b453e565e1f2786d to your computer and use it in GitHub Desktop.
Save duanebester/92a6551147c91e31b453e565e1f2786d to your computer and use it in GitHub Desktop.
App 0
const mapConfig = {
style: "mapbox://styles/mapbox/outdoors-v10",
containerStyle: {
height: "100vh",
width: "100vw"
},
center: { lat: 30.266666, lng: -97.73333 },
flyToOptions: {
speed: 0.8
}
};
const Map = ReactMapboxGl({
accessToken: process.env.REACT_APP_MAPBOX_TOKEN
});
function App() {
const [mapState, setMapState] = useState({ zoom: [6], loaded: false });
return (
<div className="App">
<Map {...mapConfig} zoom={mapState.zoom}></Map>
</div>
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment