mapkit

multiple regionDidChangeAnimated calls - what gives?

I have a MKMapView inside a UITableView as a custom cell (don't ask ;) - don't know if it matters really), for which I register a regionDidChangeAnimated delegate method. This method gets called three times when the UITableView is loaded - once with the actual region and then two more times with a region that is way off. In the simulator...

What is the delegate method that is called when an MKPinAnnotationView is touched?

I have been searching for this all night and I have just so frustrated. When a MKPinAnnotationView is clicked, the name and the subtitle comes up. I also want to center that point on the view. I figured there was some method I had to override because the information that pops up happened without me having to code it. Hopefully this was c...

Getting the bounds of an MKMapvIew

In order to setup a query to an external server I want to get the bounds of the current Map View in an iPhone app I'm building. UIView should respond to bounds but it seems MKMapView doesn't. After setting a region and zooming in the map I try to get the bounds. I'm stuck on the first step which is to try to get the CGPoints that represe...

How can I know when MKMapview setRegion:animated: has finished?

I want to set a region on my MKMapView and then find the coordinates corresponding to the NE and SW corner of the map. This code works just fine to do that: //Recenter and zoom map in on search location MKCoordinateRegion region = {{0.0f, 0.0f}, {0.0f, 0.0f}}; region.center = mySearchLocation.searchLocation.coordinate; region.span.long...

iPhone MapKit: Annotation images get reset back to pins

I'm adding several annotations to a MapView and using a custom image instead of the default pins. I am using the viewForAnnotation delegate method to set the custom image like this: view.image = [UIImage imageNamed:@"placemark.png"]; And I've also tried: [(MKPinAnnotationView *)view setImage:[UIImage imageNamed:@"placemark.png"]]; ...

How do I know when setregion on an MKMapView won't fire regionWillChange/regionDidChange

I'm working on some iPhone MapKit code which fires off some events when the boundaries of the map change (basically some queries to an external server). There is one edge case I can't seem to solve. When users enter a new address I use setRegion to zoom in on that location and afterwards I compute the bounds of the map and query my exter...

Calculating driving distance in iPhone

Hi, I need to find the driving distance between 2 locations. I do not need to display the directions in a map, just need to calculate the distance, which I need to use in my application. Does MapKit allow this? Is there an alternative that can be used? I am able to get forward geo-coding using CloudMade, but there doesn't seem to be ...

Centering map against user's location

I'd like to center a map (mapkit) against the user's location. I do the following in the simulator but only get a blue map with no content. What steps should I be taking? MKCoordinateRegion region; MKCoordinateSpan span; span.latitudeDelta=0.2; span.longitudeDelta=0.2; CLLocationCoordinate2D location; location.latitude = mapView.user...

How do you enable full horizontal scrolling on Mapkit?

I've added MapKit to an app I've been working on. However, there appears to be a wall between Asia and America that you can't scroll past horizontally, to the right or to the left. Is there an option to enable infinite horizontal scrolling, such that the map wraps around? ...

Accessing a MKMapView through the tab bar

I have a tabbar application and on the first tab I have a MKMapView. What I want to do is from somewhere else in the application, switch the active tab to the mapview and set the mapview's region based on the data in the previous view (the one with the button to switch to the mapview). What I've tried is: [self.tabBarController setSele...

Retrieve UserLocation Coordinate with MapKit

Hi, I"m using MapKit in my application and disaply the user location with [mapview setShowUserLocation:YES]; I want to set the region.center.latitude and region.center.longitude with the coordinate of the userLocation, how to do it? ...

specifying a placemark in at a particular location, iphone

i'm creating a maps application (just for illustration), i need to place some placemarks on the maps which are getting loaded. At different locations. I have been able to placea marking on the location where the map is first loaded. i'm giving out the latitude and longitude of the location, and by geocoder(MKReverseGeocoder), i'm placing...

Why am I crashing after MKMapView is freed if I'm no longer using it?

I have a MKMapView. Sometimes after my view controller is dismissed, I'll get a EXC_BAD_ACCESS. I turned on NSSZombies and it looks like the MKMapView's delegate — my view controller! — is being called, despite both the MKMapView and UIViewController subclass being freed. I've checked, and my memory management is correct. What's going ...

How to open call out MKAnnotationView programmatically? (iPhone, MapKit)

I want to open up the callout for an MKPinAnnotationView programmatically. Eg I drop 10 pins on the map, and want to open up the one closest to me. How would I go about doing this? Apple has specified the 'selected' parameter for MKAnnotationView's, but discourages setting it directly (this doesn't work, tried it). For the rest MKAnnot...

Use mapkit to calculate distance between two addresses ?

Hi Is it possible to use the mapkit in the iphone sdk to calculate distance between two addresses ? Thanks for the help. ...

iPhone mapView / mapKit using removeAnnotation & addAnnotation results in memory leak?

To update the location of a GPS indicator on mapView... [mapView removeAnnotation:myGpsAnnotation]; [myGpsAnnotation release]; myGpsAnnotation = nil; myGpsAnnotation = [[MapLocationAnnotation alloc] initWithCoordinate:region.center annotationType:MapAnnotationTypeGps title:MAP_ANNOTATION_TYPE_GPS]; [mapView addAnnotation:myGpsAnnotation...

Is there a callback to use to tell when the user's location is available

I'm after a callback or protocol that will notify me when the user's location is available. So that when a user's location is found I can zoom into where they are. What can I use to do this? I was thinking there waas something in CoreLocation that could do it, but I can't find how to do it. [Update] I've implemented <CLLocationManager...

Toubleshooting mapkit performance

I'm plotting over 500 points on a map using mapkit. Zooming is a little jittery compared to the native google map app. I've discovered what is causing the slowness. I'm adding custom annotations so that I can later add different pin colors and buttons for detail views: - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnota...

Navigation Controller w/ TableView +MapView problem

Hi everybody, I'm building right now an iPhone app that basically is organized as follows: We have a Navigation Controller with a Table View all inside of a TabBar (a classic in iPhone apps) then in one of my tabs I fill the table view with data extracted from a DB in sqlite, so this far I have no problems, I display the drill down cor...

Hiding map annotations without deleting them.

Using a MKMapView I have a pile of annoatations loaded onto it and I want to be able to filter the annotations displayed with a segmented control. I'm using custom annotations with a type variable so I can tell them apart from one another but I haven't been able to find a way to hide and display a subset of annotation views at will. ...