이학준
2 years ago
1 changed files with 16 additions and 31 deletions
@ -1,36 +1,21 @@ |
|||||||
import {WINDY_KEY} from '../../configs/constants' |
import { WINDY_KEY } from '../../configs/constants'; |
||||||
export const WeatherView = () => { |
export const WeatherView = () => { |
||||||
const options = { |
const options = { |
||||||
// Required: API key
|
// Required: API key
|
||||||
key:WINDY_KEY, // REPLACE WITH YOUR KEY !!!
|
key: WINDY_KEY // REPLACE WITH YOUR KEY !!!
|
||||||
|
|
||||||
// Put additional console output
|
// Put additional console output
|
||||||
|
|
||||||
// Optional: Initial state of the map
|
// Optional: Initial state of the map
|
||||||
lat: 37.12, |
}; |
||||||
lon: 130.11, |
|
||||||
zoom: 7, |
|
||||||
}; |
|
||||||
|
|
||||||
//Initialize Windy API
|
return ( |
||||||
windyInit(options, windyAPI => { |
<> |
||||||
// windyAPI is ready, and contain 'map', 'store',
|
<iframe |
||||||
// 'picker' and other usefull stuff
|
style={{ width: '100%', height: '99vh' }} |
||||||
// const { map } = windyAPI;
|
src='https://embed.windy.com/embed2.html?lat=37.549&lon=126.658&detailLat=37.549&detailLon=126.658&zoom=7&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=default&metricTemp=default&radarRange=-1' |
||||||
// .map is instance of Leaflet map
|
></iframe> |
||||||
|
</> |
||||||
// L.popup()
|
); |
||||||
// .setLatLng([37.12, 130.11])
|
}; |
||||||
// .setContent('Hello World')
|
|
||||||
// .openOn(map);
|
|
||||||
|
|
||||||
}); |
|
||||||
|
|
||||||
|
|
||||||
return ( |
|
||||||
<> |
|
||||||
<iframe style={{ width: '100%', height: '99vh' }} src="https://embed.windy.com/embed2.html?lat=37.549&lon=126.658&detailLat=37.549&detailLon=126.658&zoom=5&level=surface&overlay=wind&product=ecmwf&menu=&message=&marker=&calendar=now&pressure=&type=map&location=coordinates&detail=&metricWind=default&metricTemp=default&radarRange=-1" frameborder="0"></iframe> |
|
||||||
</> |
|
||||||
) |
|
||||||
} |
|
||||||
export default WeatherView; |
export default WeatherView; |
||||||
|
Loading…
Reference in new issue