Created
August 13, 2020 15:01
-
-
Save andion/b3080efee318a81b3a53015ece052b22 to your computer and use it in GitHub Desktop.
This file contains 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 React from 'react' | |
import { render } from 'react-dom' | |
import { Map, Marker, Popup, TileLayer } from 'react-leaflet' | |
const position = [43.385807,-8.406524] | |
const map = ( | |
<Map center={position} zoom={16}> | |
<TileLayer | |
url="https://api.mapbox.com/styles/v1/{id}/tiles/{z}/{x}/{y}?access_token=pk.eyJ1IjoibWFwYm94IiwiYSI6ImNpejY4NXVycTA2emYycXBndHRqcmZ3N3gifQ.rJcFIG214AriISLbB6B5aw" | |
attribution='Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, | |
<a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, | |
Imagery © <a href="https://www.mapbox.com/">Mapbox</a>' | |
/> | |
<Marker position={position}> | |
<Popup>A pretty CSS3 popup.<br />Easily customizable.</Popup> | |
</Marker> | |
</Map> | |
) | |
render(map, document.getElementById('map-container')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment