//Creating the point
CLLocationCoordinate2D centerPoint;
centerPoint.latitude = 36.966029;
centerPoint.longitude = -121.977739;
//print out its contents
NSLog(@"Coords should be: lat %f,long %f ", centerPoint.latitude,centerPoint.longitude);
// create the map view
_map = [[RMMapView alloc]
initWithFrame: self.view.bounds
andTilesource:cartoSource
centerCoordinate:centerPoint
zoomLevel:6
maxZoomLevel:18
minZoomLevel:1
backgroundImage:nil];
//print out its centerCoordinates
NSLog(@"NEW coords: lat %f,long %f ", _map.centerCoordinate.latitude,_map.centerCoordinate.longitude);
//set the center coordinates AGAIN
[_map setCenterCoordinate:centerPoint animated:0];
//print out centerCoordinates
NSLog(@"NEW coords: lat %f,long %f ", _map.centerCoordinate.latitude,_map.centerCoordinate.longitude);
The NSLogs print out the following:
Coords should be: lat 36.966029,long -121.977739
NEW coords: lat 0.000000,long 0.000000
NEW coords: lat 0.000000,long 0.000000
NEW coords: lat 0.000000,long 0.00 000
No matter what coordinates I set my centerCoordinate to, it is always 0.
The same does not happen when I use another constructor like
say
[initWithFrame:];
My code is this
The NSLogs print out the following:
No matter what coordinates I set my centerCoordinate to, it is always 0. The same does not happen when I use another constructor like say
[initWithFrame:];
What am I doing wrong? Is this a bug?