mirror of
https://github.com/visgl/react-map-gl.git
synced 2025-12-08 20:16:02 +00:00
23 lines
481 B
JavaScript
23 lines
481 B
JavaScript
import * as React from 'react';
|
|
import Map from 'react-map-gl';
|
|
|
|
import 'mapbox-gl/dist/mapbox-gl.css';
|
|
|
|
const MAPBOX_TOKEN = ''; // Set your mapbox token here
|
|
|
|
export default function MapView() {
|
|
return (
|
|
<Map
|
|
id="mymap"
|
|
initialViewState={{
|
|
longitude: -122.4,
|
|
latitude: 37.8,
|
|
zoom: 14
|
|
}}
|
|
style={{width: 800, height: 600}}
|
|
mapStyle="mapbox://styles/mapbox/streets-v9"
|
|
mapboxAccessToken={MAPBOX_TOKEN}
|
|
/>
|
|
);
|
|
}
|