File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -244,17 +244,22 @@ export default function DashboardLayoutBasic() {
244244 return ;
245245 }
246246
247- const dz = findClosestDropzone ( new Point ( target . target . lat , target . target . lng ) ) ;
247+ const targetPoint = new Point ( target . target . lat , target . target . lng ) ;
248+ let dz = findClosestDropzone ( new Point ( target . target . lat , target . target . lng ) ) ;
249+
250+ if ( targetPoint . distanceTo ( new Point ( dz . lat , dz . lng ) ) > 5000 ) {
251+ dz = null ;
252+ }
248253 const { forecastSource } = settings ;
249254
250255 console . log (
251256 `Fetching winds using ${ forecastSource } for: ${ JSON . stringify ( target . target ) } ,`
252- + ` useDzGroundWind=${ settings . useDzGroundWind } (dz=${ dz . name } )`
257+ + ` useDzGroundWind=${ settings . useDzGroundWind } (dz=${ dz ? .name } )`
253258 ) ;
254259
255260 setFetching ( true ) ;
256261
257- fetchForecast ( forecastSource , target . target , settings . useDzGroundWind && dz . fetchGroundWind )
262+ fetchForecast ( forecastSource , target . target , settings . useDzGroundWind && dz ? .fetchGroundWind )
258263 . then ( fetchedWinds => {
259264 let limit = settings . limitWind ;
260265
You can’t perform that action at this time.
0 commit comments