@times-visuals/leaflet-map
v1.2.0
Published
Template for creating leaflet maps
Downloads
2
Keywords
Readme
Leaflet map
Output a simple Leaflet map with additional geo data
Installation
# Yarn
$ yarn add @times-visuals/leaflet-map
# npm
$ npm add @times-visuals/leaflet-map
Usage
Optional parameters:
position
: a[lat, lon]
arrayzoom
: aninteger
tileset
: an object containingurl, attribution
, and maybeext
- plenty can be found on the Leaflet providers list
Custom zoom and centering
import LeafletMap from "@times-visuals/leaflet-map";
export default () => <LeafletMap position={[52.518391, 13.403617]} zoom={10} />;
Custom tileset
import LeafletMap from "@times-visuals/leaflet-map";
const stamenTonerTileset = {
url:
"https://stamen-tiles-{s}.a.ssl.fastly.net/toner-lite/{z}/{x}/{y}{r}.{ext}",
attribution:
'Map tiles by <a href="http://stamen.com">Stamen Design</a>, <a href="http://creativecommons.org/licenses/by/3.0">CC BY 3.0</a> — Map data © <a href="http://www.openstreetmap.org/copyright">OpenStreetMap</a>',
ext: "png"
};
export default () => (
<LeafletMap
position={[52.518391, 13.403617]}
zoom={10}
tileset={stamenTonerTileset}
/>
);