I got a switch that takes the name of a city and set it's map coordinates in a global variable:
var lat : CLLocationDegrees = CLLocationDegrees.init(0.0)
var lng : CLLocationDegrees = CLLocationDegrees.init(0.0)
switch city {
case "malaga":
lat = 36.719646
lng = -4.420071
break
case "utrecht":
lat = 52.092876
lng = 5.104480
break
case "rome":
lat = CLLocationDegrees.init(41.890251)
lng = CLLocationDegrees.init(12.492373)
default:
lat = CLLocationDegrees.init(41.890251)
lng = CLLocationDegrees.init(12.492373)
globCountry = "Rome"
}
googleLatLng.latitude = lat
googleLatLng.longitude = lng
But since it was sending me to Algeria everytime I was choosing Rome, I did a bit of investigation and seen that rome coordinates weren't correct. After set some breakpoints in the switch
were the coordinates were set, I seen the map coordinates variables weren't taking their correct value:
You can see in the console the city variable content is "rome". The breakpoint after set the lat
float number shows an incorrect value. Can anybody help me to solve this?