diff --git a/samples/MapTestbed/Classes/MapTestbedAppDelegate.m b/samples/MapTestbed/Classes/MapTestbedAppDelegate.m index 5c0cda1..9ec012a 100644 --- a/samples/MapTestbed/Classes/MapTestbedAppDelegate.m +++ b/samples/MapTestbed/Classes/MapTestbedAppDelegate.m @@ -48,11 +48,9 @@ UIImage *xMarkerImage = [UIImage imageNamed:@"marker-X.png"]; // if we zoom with bounds after the paths are created, nothing is displayed on the map - CLLocationCoordinate2D northeast, southwest; - northeast.latitude = 48.885875363989435f; - northeast.longitude = 2.338285446166992f; - southwest.latitude = 48.860406466081656f; - southwest.longitude = 2.2885894775390625; + CLLocationCoordinate2D northeast = CLLocationCoordinate2DMake(48.885875363989435f, 2.338285446166992f), + southwest = CLLocationCoordinate2DMake(48.860406466081656f, 2.2885894775390625); + [mapView zoomWithLatitudeLongitudeBoundsSouthWest:southwest northEast:northeast animated:NO]; CLLocation *one, *two, *three, *four; @@ -61,7 +59,7 @@ three = [[[CLLocation alloc] initWithLatitude:48.87351371451778f longitude:2.2948551177978516f] autorelease]; four = [[[CLLocation alloc] initWithLatitude:48.86600492029781f longitude:2.3194026947021484f] autorelease]; NSArray *linePoints = [NSArray arrayWithObjects:one, two, three, four, nil]; - + // draw a green path south down an avenue and southeast on Champs-Elysees RMAnnotation *pathAnnotation = [RMAnnotation annotationWithMapView:mapView coordinate:one.coordinate andTitle:nil]; pathAnnotation.annotationType = @"path"; diff --git a/samples/MarkerMurder/Classes/MainViewController.m b/samples/MarkerMurder/Classes/MainViewController.m index 1d2c373..7a99792 100644 --- a/samples/MarkerMurder/Classes/MainViewController.m +++ b/samples/MarkerMurder/Classes/MainViewController.m @@ -47,15 +47,16 @@ UIImage *blueMarkerImage = [UIImage imageNamed:@"marker-blue.png"]; markerPosition.latitude = center.latitude - ((kNumberRows - 1)/2.0 * kSpacing); - int i, j; - for (i = 0; i < kNumberRows; i++) + + for (int i = 0; i < kNumberRows; i++) { markerPosition.longitude = center.longitude - ((kNumberColumns - 1)/2.0 * kSpacing); - for (j = 0; j < kNumberColumns; j++) + + for (int j = 0; j < kNumberColumns; j++) { markerPosition.longitude += kSpacing; - NSLog(@"Add marker @ {%f,%f}", markerPosition.longitude, markerPosition.latitude); + NSLog(@"Add marker @ {%f,%f} = {%f,%f}", markerPosition.longitude, markerPosition.latitude, [mapView coordinateToProjectedPoint:markerPosition].x, [mapView coordinateToProjectedPoint:markerPosition].y); RMAnnotation *annotation = [RMAnnotation annotationWithMapView:mapView coordinate:markerPosition andTitle:[NSString stringWithFormat:@"%4.1f", markerPosition.longitude]]; @@ -170,7 +171,7 @@ if ([annotation.annotationType isEqualToString:kRMClusterAnnotationTypeName]) { - marker = [[[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"marker-blue.png"] anchorPoint:annotation.anchorPoint] autorelease]; + marker = [[[RMMarker alloc] initWithUIImage:[UIImage imageNamed:@"marker-blue.png"] anchorPoint:CGPointMake(0.5, 1.0)] autorelease]; if (annotation.title) [(RMMarker *)marker changeLabelUsingText:annotation.title]; }