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

Functions

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');
});

mapLibre

Const mapLibre: Object

Following object (singleton) contains all the stuff required for integration of mapLibre Gl into the client.

Type declaration

NameTypeDescription
wrapperMapLibreMap | nullInstance of our own mapLibre map wrapper Class

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 );

Functions

isGlobeActive

isGlobeActive(): boolean

Just handy shortcut to detect that globe is active

Returns

boolean