· 10 months ago · Nov 22, 2024, 01:35 PM
1const options = {
2 // Required: API key
3 key: 'HIwXiNGJ1zV2P0EABJJRxzep4cjMpObc', // REPLACE WITH YOUR KEY !!!
4
5 // Put additional console output
6 verbose: true,
7
8 // Optional: Initial state of the map
9 lat: 50.4,
10 lon: 14.3,
11 zoom: 5,
12};
13
14// Initialize Windy API
15windyInit(options, windyAPI => {
16 // windyAPI is ready, and contain 'map', 'store',
17 // 'picker' and other usefull stuff
18
19 const { map } = windyAPI;
20 // .map is instance of Leaflet map
21
22 L.popup()
23 .setLatLng([50.4, 14.3])
24 .setContent('Hi, I'm Filipe Fernandes, and this is my world.')
25 .openOn(map);
26});