Ahhh ... well, calm down.
Anyone having trouble setting up the MKMapView area? He never worked with me.
This code:
-(void)setUserCenteredSpan:(MKCoordinateSpan)span{ // for this example, span = {0.5, 0.5} // Current region (just initialised) NSLog(@"%f, %f - %f, %f", self.region.center.latitude, self.region.center.longitude, self.region.span.latitudeDelta, self.region.span.longitudeDelta); // New Region MKCoordinateRegion region = MKCoordinateRegionMake([[[self userLocation] location] coordinate], span); NSLog(@"%f, %f - %f, %f", region.center.latitude, region.center.longitude, region.span.latitudeDelta, region.span.longitudeDelta); // Region saved in MKMapView [self setRegion:region animated:NO]; NSLog(@"%f, %f - %f, %f", self.region.center.latitude, self.region.center.longitude, self.region.span.latitudeDelta, self.region.span.longitudeDelta); }
Returns this log:
30.145127, -40.078125 - 0.000000, 0.000000 0.000000, 0.000000 - 0.500000, 0.500000 0.000000, 0.000000 - 0.000000, 0.000000
Do you know why ?!
Thank you very much, you can save me from killing yourself X (
March
EDIT: Of course, I'm on a device connected to the internet.