sanguu
2 years ago
8 changed files with 82 additions and 2 deletions
@ -0,0 +1,18 @@
|
||||
import { lazy } from 'react'; |
||||
|
||||
const RouteWeather = [ |
||||
|
||||
{ |
||||
path: '/weather/info/index', |
||||
component: lazy(() => |
||||
import('../../views/weather/WeatherView') |
||||
), |
||||
layout: 'BlankLayout' |
||||
// meta: {
|
||||
// open: '/analysis/history/list'
|
||||
// // naveLink: '/analysis/history/detail'
|
||||
// }
|
||||
} |
||||
]; |
||||
|
||||
export default RouteWeather; |
@ -0,0 +1,36 @@
|
||||
import {WINDY_KEY} from '../../configs/constants' |
||||
export const WeatherView = () => { |
||||
const options = { |
||||
// Required: API key
|
||||
key:WINDY_KEY, // REPLACE WITH YOUR KEY !!!
|
||||
|
||||
// Put additional console output
|
||||
|
||||
// Optional: Initial state of the map
|
||||
lat: 37.12, |
||||
lon: 130.11, |
||||
zoom: 7, |
||||
}; |
||||
|
||||
//Initialize Windy API
|
||||
windyInit(options, windyAPI => { |
||||
// windyAPI is ready, and contain 'map', 'store',
|
||||
// 'picker' and other usefull stuff
|
||||
// const { map } = windyAPI;
|
||||
// .map is instance of Leaflet map
|
||||
|
||||
// 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; |
Loading…
Reference in new issue