diff options
| author | Yuval Adam <_@yuv.al> | 2019-10-15 22:42:28 +0300 |
|---|---|---|
| committer | Yuval Adam <_@yuv.al> | 2019-10-16 10:31:54 +0300 |
| commit | c99f38d54667915a52047d598da40815236cd3ca (patch) | |
| tree | a27ff99f669ae407b8b43415777debbef0039c6e /src/Map.js | |
| parent | b756d154df3fcd45449e93de01832eb32f843aa2 (diff) | |
Extract Map.js
Diffstat (limited to 'src/Map.js')
| -rw-r--r-- | src/Map.js | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/Map.js b/src/Map.js new file mode 100644 index 0000000..78dbebf --- /dev/null +++ b/src/Map.js @@ -0,0 +1,28 @@ +import React, { useState } from 'react'; +import ReactMapboxGl, { Layer, Feature } from 'react-mapbox-gl'; +import 'mapbox-gl/dist/mapbox-gl.css'; + +const MAPBOX_ACCESS_TOKEN = 'pk.eyJ1IjoieXV2YWRtIiwiYSI6ImNpcnMxbzBuaTAwZWdoa25oczlzZmkwbHcifQ.UHtLngbKm9O8945pJm23Nw'; + +const Mapbox = ReactMapboxGl({ + accessToken: MAPBOX_ACCESS_TOKEN, + minZoom: 5, + maxZoom: 10, + hash: false, +}); + +function Map() { + const [center, setCenter] = useState([35, 31.9]); + const [zoom, setZoom] = useState([6.3]); + + return ( + <Mapbox style="mapbox://styles/mapbox/dark-v9" center={center} zoom={zoom} + containerStyle={{ + height: '100vh', + width: '100vw' + }} + ></Mapbox> + ); +} + +export default Map; |
