Skip to content

@windy/map

Already initialized instance of Leaflet map and other map related functions and stuff

Instance of Leaflet map is available as map in this module.

Windy.com uses Leaflet version 1.4.0 that is well documented here and contains plenty of plugins that you can use.

Table of contents

Variables

Variables

map

Const map: Map

Already initialized instance of Leaflet L.Map

Example

js
import { map } from '@windy/map';

map.on('zoomend', () => {
   console.log('Map was zoomed');
});

markers

Const markers: Record<string, L.DivIcon>

Already initialized reusable set of minimalistic Leaflet markers

icon Pulsating icon

pulsatingIcon Pulsating icon forever

myLocationIcon Blue icon of user's location

Example

js
import { map, markers } from '@windy/map';

const myPulsatingMarker = L.marker([ 50, 14 ], {
    icon: markers.pulsatingIcon
  }).addTo( map );