mkmapview

iPhone - Problem with MKMapView instance

Hi, I've got a problem with a MKMapView, which is placed as a full-sized view in a UITabBarController at first position. Before the view will be shown, I add several annotations to the mapView. Everything just works fine. When I change the tab (so that the mapView is out of view) and switch back to the tab with the mapView, all annotat...

iPhone - remove pin annotations of map, but not mine

Hello! I use a MapView and I set annotations on it (purple pins) and my user location (which is a blue circle). Because the purple pin annotations will move, I have to remove and set them new to the map. I set it with: CLLocationCoordinate2D coordinate; coordinate.latitude = 49.2802; coordinate.longitude = -123.1182; NSUInteger count ...

using a UIView as MKMapView subview to draw a route

Hi!Before anything i'm sorry for my bad english. I'm trying to draw a route in a UIView and set that view as a MKMapView. Now i have a UIView class (ViewClass) where i put all the touches methods and set the view of my viewcontroller as an instance of that class. The MKMapView is a viewcontroller.view subview. I can get all the touch...

MKMapView -> display a button for my location

Hello to all! I have a MKMapView implemented with these lines of source code (my location is a blue bullet, the other one's are purple pins): - (MKAnnotationView *)mapView:(MKMapView *)mapViewLocal viewForAnnotation:(id <MKAnnotation>)annotation { if (annotation == mapViewLocal.userLocation) { mapViewLocal.userLocation.titl...

Google map on iphone apps : current location

Hi, I am working on an iPhone app in which I am implementing a map view. When the map loads, a purple pin is displayed at the current location. My problem is that I want to show the current location on a new view when the user touches this purple pin. Any idea? Please help. Thanks, Aaryan ...

iPhone: mapView.showUserLocation. VS locationUpdate function

Hi, I have a question. I'm developing on an app that is location-based, I have a mapView set to show the user location (mapView.showUserLocation); I also have a locationUpdate function to retrive lat/long of current position: (void)locationUpdate:(CLLocation *)location{} After I call the function stopUpdatingLocation to stop the upd...

Low memory problem drawing a route with MKAnnotationView

Hi! I'm drawing a route like it's done in http://spitzkoff.com/craig/?p=81 but i'm not loading de coordinates from a file, i get the coordinates from GPS with CLLocationManager. The problem is that my app crash with low memory in the device. I guess it's the way i'm drawing the route. In - (MKAnnotationView *)mapViewMKMapView *)_mapVi...

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...

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...

MKMapView boundaries?

Anyone know of an easy way to implement boundaries on an MKMapView. For example, I want to tell the map it can only stay in one area. I want to user to be able to scroll but have them stop when they get to a certain latitude/longitude. I tried using the willChangeRegion: delegate but that screwed me over. Thanks. ...

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...

MKMapView: Pins over the pop up

This question was asked earlier by someone else but never answered: http://stackoverflow.com/questions/1458052/mkannotation-map-pin-callout-pops-up-behind-other-map-pins. I ran into this problem yesturday and I have no clue what caused this problem and was hoping someone else has had this problem but figured it out. ...

iPhone: MKMapView zooming out and back in causes the maps region.center to drift

I have a simple iphone app that uses the MKMapView. It has a segmented control that will adjust the region to zoom (street, neighborhood, city, state, world). It works OK but if I zoom out to state level and back to street, I notice that the center point has shifted. The following are two delegate methods that get called before and ...

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...

MKMapView tile-based overlay

I want to draw a tile-based overlay on top of a MKMapView, but there's no obvious way to do this. This appears to be tricky since you can zoom to any level with MKMapView (unlike Google Maps). Has anyone attempted to do this? ...

iPhone MkMapView lock center to userlocation

Hello. I have a MkMapView and want to keep the Map centered to the user's location, exaclty as the iPhone Map Application does when you press the scope button. I am using the setCenterCoordinate method because I don't need to set the zoom. I use it everytime the location is updated from the location manager. The problem is that as it u...

Sanity Check an MKCoordinateRegion

Is there any way to quickly test whether an MKCoordinateRegion is good or not? I've swapped latitude for longitude and caused an application crash. I'd like to be able to see whether it's possible to perform a setRegion before I actually do it. Will MKCoordinateRegionMake test the values I give it? Thanks. ...

iphone sdk compare relative angle between two coordinates

hi! Supos i have two coordinates on a MapView. Hoe can i calculate the angle relative to the north between those two positions? Thanks ...