Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@andion
Created August 13, 2020 15:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andion/b3080efee318a81b3a53015ece052b22 to your computer and use it in GitHub Desktop.
Save andion/b3080efee318a81b3a53015ece052b22 to your computer and use it in GitHub Desktop.
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 &copy; <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