@teikei/map
Version:
Teikei map SPA component. Teikei is the software that powers ernte-teilen.org, a website that maps out Community-supported Agriculture in Germany.
21 lines (17 loc) • 535 B
JavaScript
import Leaflet from 'leaflet'
import config from '../../configuration'
const iconUrl = () => ({
Depot: `${config.assetsBaseUrl}/marker-depot.svg`,
Farm: `${config.assetsBaseUrl}/marker-farm.svg`,
Initiative: `${config.assetsBaseUrl}/marker-initiative.svg`
})
const markerIcon = type =>
Leaflet.icon({
shadowUrl: `${config.assetsBaseUrl}/marker-shadow.png`,
iconSize: [40, 50],
iconAnchor: [20, 50],
shadowSize: [50, 60],
popupAnchor: [0, -50],
iconUrl: iconUrl()[type]
})
export default markerIcon