File tree 1 file changed +4
-4
lines changed
1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -26,8 +26,6 @@ import { LoadWeather } from '../actions/weather.actions';
26
26
} )
27
27
export class WeatherComponent implements OnInit {
28
28
29
- lat : string ;
30
- long : string ;
31
29
cardsDesktop = [ ] ;
32
30
cardsMobile = [ ] ;
33
31
displayValues = false ;
@@ -188,8 +186,10 @@ export class WeatherComponent implements OnInit {
188
186
onSelectionChanged ( event : MatAutocompleteSelectedEvent ) {
189
187
for ( const city of this . cities ) {
190
188
if ( city . combinedName === event . option . value ) {
191
- this . locationData . latitude = city . latitude ;
192
- this . locationData . longitude = city . longitude ;
189
+ const latitude = parseFloat ( city . latitude ) ;
190
+ const longitude = parseFloat ( city . longitude ) ;
191
+ this . locationData . latitude = latitude . toFixed ( 4 ) . toString ( ) ;
192
+ this . locationData . longitude = longitude . toFixed ( 4 ) . toString ( ) ;
193
193
this . store . dispatch ( new LoadWeather ( { weatherData : null } ) ) ;
194
194
this . store . dispatch ( new LoadLocations ( { locationData : this . locationData , error : null } ) ) ;
195
195
break ;
You can’t perform that action at this time.
0 commit comments