Search Results

Search found 152 results on 7 pages for 'mapkit'.

Page 2/7 | < Previous Page | 1 2 3 4 5 6 7  | Next Page >

  • How to tell a rightCalloutAccessoryView has been touched for MapKit

    - by iamdadude
    I have a MKAnnotationView being allocated with a DetailDisclosure button being displayed on the right side of the annotation. How would I go about knowing when a user clicked on the annotation button? This is what my code looks like right now - UIButton *rightButton = [UIButton buttonWithType:UIButtonTypeDetailDisclosure]; pinView.rightCalloutAccessoryView = rightButton; pinView.animatesDrop = YES; Is there a built in method to detect when a accessory view has been touched? I'm guessing it would be like the UITableView methods, but I can't find anything. Thanks for any help.

    Read the article

  • How to display user location in mapkit?

    - by 4thSpace
    I'd like to display the blue pulsing dot for a user's location. I'm doing this: - (void)locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ //some other stuff here [self.mapView setShowsUserLocation:YES]; } But I eventually get -[MKUserLocation establishment]: unrecognized selector sent to instance 0x125e90 Should I be doing this some other way?

    Read the article

  • iPhone mapKit annotation for Current Location

    - by Simon
    Hello Im currently strugglung with annotations. how can i prevent the AnnotationLable for the blue GPS-point. (Here is an Image) - (MKAnnotationView *) mapView:(MKMapView *)mapView viewForAnnotation:(MKAnnotation *) annotation{ if (annotation == mapView.userLocation) { return nil; } the function above isnt working, and i realized that i can't compare two coordinates. Any hint is welcome. Simon

    Read the article

  • Mapkit: Only show annotations in current view

    - by Nic Hubbard
    Instead of loading all annotations that are in my array, I would only like to load the annotations that the user could currently see cased on how far they are zoomed in on the map. So, if the user pans to a place where there are annotations, those would be added, and if they pan away, those would be removed. I assume this would help with memory. Does anyone know how to do something like this? And, is it worth it, or needed?

    Read the article

  • iPhone mapkit: selecting a location on the map

    - by Tristan
    Hi there, I'd like to be able to select a location on a MKMapView. Ideally the user would be able to place their finger on a pin, drag it around the map, and then let go above there area they wish to place it. I'm stumped. Does anyone have any clever ideas how this could be achieved?

    Read the article

  • ReverseGeoCoder Fail Error in Mapkit

    - by Biranchi
    Hi All, I am making the ReverseGeoCoder request with the following latitude and longitude Latitude = 37.296740 Longitude = -122.001878 I am getting an error as "/SourceCache/ProtocolBuffer/ProtocolBuffer-19/Runtime/PBRequester.m:446 server returned error: 503" With the ReverseGeoCoder fail message as "Error Domain=PBRequesterErrorDomain Code=6001 "Operation could not be completed. (PBRequesterErrorDomain error 6001.)" What is this error due to ?? Any ideas ?? Thanks

    Read the article

  • Zooming out to fit all annotations in MapKit

    - by Krismutt
    Hey everybody!! I wanna zoom out so that all my annotations(my location and one more annotation) fit to the screen...what do I do wrong?? I get the following warning: "'getDistanceFrom:' is deprecated".... -(void)viewDidLoad { [super viewDidLoad]; mapView = [[MKMapView alloc] initWithFrame:self.view.bounds]; mapView.showsUserLocation = TRUE; mapView.delegate = self; mapView.mapType = MKMapTypeStandard; mapView.zoomEnabled = YES; mapView.scrollEnabled = YES; mapView.userInteractionEnabled = YES; [mapView.userLocation setTitle:@"Nuvarande plats"]; [mapView.userLocation setSubtitle:@"Du är här"]; [self.view insertSubview:mapView atIndex:0]; self.locationManager = [[[CLLocationManager alloc] init] autorelease]; locationManager.delegate = self; locationManager.desiredAccuracy = kCLLocationAccuracyBest; [locationManager startUpdatingLocation]; [mapView release]; } -(void) locationManager: (CLLocationManager *)manager didUpdateToLocation:(CLLocation *)newLocation fromLocation:(CLLocation *)oldLocation{ NSLog (@"Position uppdateras" ); location = newLocation.coordinate; if (friZoom) { MKCoordinateRegion region; region.center.latitude = location.latitude; region.center.longitude= location.longitude; MKCoordinateSpan span; span.latitudeDelta = 0.01; span.longitudeDelta = 0.01; region.span = span; [mapView setRegion:region animated:TRUE];} } - (MKAnnotationView *)mapView:(MKMapView *)mapview viewForAnnotation:(id <MKAnnotation>)knappnal { if ([knappnal isKindOfClass:MKUserLocation.class]) { return nil; } MKPinAnnotationView *knappnalView = (MKPinAnnotationView*)[mapview dequeueReusableAnnotationViewWithIdentifier:@"annot"]; if (!knappnalView) { knappnalView = [[[MKPinAnnotationView alloc] initWithAnnotation:knappnal reuseIdentifier:@"annot"] autorelease]; knappnalView.pinColor = MKPinAnnotationColorRed; knappnalView.animatesDrop = YES; knappnalView.canShowCallout = YES; } else { knappnalView.annotation = knappnal; } return knappnalView; } - (IBAction)storeLocationInfo:(id) sender{ SparaPosition *position=[[SparaPosition alloc] initWithCoordinate:location]; [mapView addAnnotation:position]; savedPosition = location; } - (IBAction)visaPosition:(id)sender{ CLLocationCoordinate2D southWest =location; CLLocationCoordinate2D northEast =savedPosition; southWest.latitude = MIN(southWest.latitude, location.latitude); southWest.longitude = MIN(southWest.longitude, location.longitude); northEast.latitude = MAX(northEast.latitude, savedPosition.latitude); northEast.longitude = MAX(northEast.longitude, savedPosition.longitude); CLLocation *locSouthWest = [[CLLocation alloc] initWithLatitude:southWest.latitude longitude:southWest.longitude]; CLLocation *locNorthEast = [[CLLocation alloc] initWithLatitude:northEast.latitude longitude:northEast.longitude]; CLLocationDistance meters = [locSouthWest getDistanceFrom:locNorthEast]; MKCoordinateRegion region; region.center.latitude = (southWest.latitude + northEast.latitude) / 2.0; region.center.longitude = (southWest.longitude + northEast.longitude) / 2.0; region.span.latitudeDelta = meters / 111319.5; region.span.longitudeDelta = 0.0; region = [mapView regionThatFits:region]; [mapView setRegion:region animated:YES]; [locSouthWest release]; [locNorthEast release]; } Would really appreciate an answer!

    Read the article

  • iOS MapKit: Selected MKAnnotation coordinates.

    - by Oh Danny Boy
    Using the code at the following tutorial, http://www.zenbrains.com/blog/en/2010/05/detectar-cuando-se-selecciona-una-anotacion-mkannotation-en-mapa-mkmapview/, I was able to add an observer to each MKAnnotation and receive a notification of selected/deselected states. I am attempting to add a UIView on top of the selection annotation to display relevant information about the location. This information cannot be conveyed in the 2 lines allowed (Title/Subtitle) for the pin's callout. - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context { Annotation *a = (Annotation *)object; // Alternatively attempted using: //Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; NSString *action = (NSString *)context; if ([action isEqualToString:ANNOTATION_SELECTED_DESELECTED]) { BOOL annotationSelected = [[change valueForKey:@"new"] boolValue]; if (annotationSelected) { // Actions when annotation selected CGPoint origin = a.frame.origin; NSLog(@"origin (%f, %f) ", origin.x, origin.y); // Test UIView *v = [[UIView alloc] init]; [v setBackgroundColor:[UIColor orangeColor]]; [v setFrame:CGRectMake(origin.x, origin.y , 300, 300)]; [self.view addSubview:v]; [v release]; }else { // Accions when annotation deselected } } } Results using Annotation *a = (Annotation *)object origin (154373.000000, 197135.000000) origin (154394.000000, 197152.000000) origin (154445.000000, 197011.000000) Results using Annotation *a = (Annotation *)[mapView.selectedAnnotations objectAtIndex:0]; origin (0.000000, 0.000000) origin (0.000000, 0.000000) origin (0.000000, 0.000000) The numbers are large. They are not relative to the view (1024 x 768). I believe they are relative to the entire map. How would I be able to detect the exact coordinates relative to the entire view so that I can appropriately position my view?

    Read the article

  • Limit Annotation number in Mapkit

    - by teddafan
    Hi all, I want to stop my app from loading more annotations after they are all added ( they are added by the user one by one). How would you do that? the following code is what i think is important (void) loadAndSortPOIs { [poiArray release]; nextPoiIndex = 0; NSString *poiPath = [[NSBundle mainBundle] pathForResource:@"pois" ofType:@"plist"]; poiArray = [[NSMutableArray alloc] initWithContentsOfFile:poiPath]; CLLocation *homeLocation = [[CLLocation alloc] initWithLatitude:homeCoordinate.latitude longitude:homeCoordinate.longitude]; for (int i = 0; i < [poiArray count]; i++) { NSDictionary *dict = (NSDictionary*) [poiArray objectAtIndex: i]; CLLocationDegrees storeLatitude = [[dict objectForKey:@"workingCoordinate.latitude"] doubleValue]; CLLocationDegrees storeLongitude = [[dict objectForKey:@"workingCoordinate.longitude"] doubleValue]; CLLocation *storeLocation = [[CLLocation alloc] initWithLatitude:storeLatitude longitude:storeLongitude]; CLLocationDistance distanceFromHome = [storeLocation getDistanceFrom: homeLocation]; NSMutableDictionary *mutableDict = [[NSMutableDictionary alloc] initWithDictionary:dict]; [mutableDict setValue:[NSNumber numberWithDouble:distanceFromHome] forKey:@"distanceFromHome"]; [poiArray replaceObjectAtIndex:i withObject:mutableDict]; [mutableDict release]; } [homeLocation release]; // now sort by distanceFromHome NSArray *sortDescriptors = [NSArray arrayWithObject: [[NSSortDescriptor alloc] initWithKey: @"distanceFromHome" ascending: YES]]; [poiArray sortUsingDescriptors:sortDescriptors]; NSLog (@"poiArray: %@", poiArray); } Thank you for your help. Best regards,

    Read the article

  • Updating the getDistanceFrom between two annotations in MapKit

    - by Krismutt
    Hey everybody! I wanna have a UILabel that shows the distance between two annotations... but how do I get it to update the distance each time the current location is updated (location)?? CLLocationCoordinate2 savedPlace = savedPosition; CLLocationCoordinate2D currentPlace = location; CLLocation *locCurrent = [[CLLocation alloc] initWithLatitude:currentPlace.latitude longitude:currentPlace.longitude]; CLLocation *locSaved = [[CLLocation alloc] initWithLatitude:savedPlace.latitude longitude:savedPlace.longitude]; CLLocationDistance distance = [locSaved distanceFromLocation:locCurrent]; [showDistance setText:[NSString stringWithFormat:@"%g", distance]]; Thanks in advance!

    Read the article

  • iPhone - Image overlay MapKit framework?

    - by Peter
    I can see with iOS4 you can now tile an image on google maps (Been looking at the TileMap example from apple). This is great as this is what I want to do, but from what I can see I need to know the GEO reference of the image so I can raster the images with the appropriate zoom levels, etc. What I have is an artist image, which is a map of a specific area and I want to overlay this image on google maps. Am I missing something here, but can this be done with a none standard map and having different zoom levels? The main reason why I need to use google maps is because of the GPS functionality, so the user will know where they currently are on the map.

    Read the article

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

    - by user266618
    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]; ...I see net memory slowly climbing in Instruments (simulator). No "Leak" blip, but "Net Bytes" and "# Net" slowly incrementing... unless this code is commented out. So I'm 100% certain this is the offending code. BUT if I do the following... [mapView removeAnnotation:myGpsAnnotation]; [myGpsAnnotation release]; myGpsAnnotation = nil; myGpsAnnotation = [[MapLocationAnnotation alloc] initWithCoordinate:region.center annotationType:MapAnnotationTypeGps title:MAP_ANNOTATION_TYPE_GPS]; [mapView addAnnotation:myGpsAnnotation]; [mapView removeAnnotation:myGpsAnnotation]; [mapView addAnnotation:myGpsAnnotation]; [mapView removeAnnotation:myGpsAnnotation]; [mapView addAnnotation:myGpsAnnotation]; ...then the "Net Bytes" and "# Net" increase much faster. Is it possible this isn't my mistake, and I'm trying to track down a leak in MapKit? Am I really leaking memory? Again, nothing appears under "Leaks", but then I don't see why Net values would be continually climbing. Thanks for any help, -Gord

    Read the article

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

    - by StijnSpijker
    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 MKAnnotationView only has a setHighlighted (same story), and canShowCallout method.. Any hints if this is possible at all?

    Read the article

  • How to get left-top and right-buttom latitude and longitude of map in MapKit For iPad ?

    - by damniatx
    Hi, i'm looking for answer about getting latitude and longitude from uimapkit. there is same problem that has been answered, but it didn't give right coordinate. http://yit.me/3ddp73 it's code from thread i'm linking above. CLLocationCoordinate2D topLeft, bottomRight; topLeft = [mapView convertPoint:CGPointMake(0,0) toCoordinateFromView:mapView]; CGPoint pointBottomRight = CGPointMake(mapView.frame.size.width, mapView.frame.size.height); bottomRight = [mapView convertPoint:pointBottomRight toCoordinateFromView:mapView]; NSLog(@"topleft = %f", topLeft); NSLog(@"bottom right = %f", bottomRight); any idea to fix this issue ? thanks

    Read the article

  • Adding a new view to a Window-based app (re: MapKit tutorial)

    - by blackkettle
    I'm trying add a new view in a window-based application but not really getting anywhere. I've been going through a great MapKit tutorial lately, http://mithin.in/2009/06/22/using-iphone-sdk-mapkit-framework-a-tutorial/ and have successfully set it up and added some further buttons and customizations. However I've gotten stuck at what I assume ought to be a brain-dead simple step. I have added a toolbar to the bottom of the app, and a 'settings' style button. Following this I created a SettingsViewController complete with it's own view. Now I'd like to connect them but I've had absolutely no luck trying to figure out how to do this. I've also gone through several other good tutorials lately, http://miketeo.net/wp/index.php/2008/08/31/simple-iphone-tutorial-part-1.html http://blog.webscale.co.in/?p=228 http://www.iphonesdkarticles.com/2009/01/uitableview-searching-table-view.html but I've gotten lost trying to tie these two bits together. I'm sure it is quite trivial to link these two items but I've had no luck.

    Read the article

  • Linking Mapkit with Core Data, Search and user location. Converting annotations from a database in a tableview with search to display in a mapview?

    - by Jon
    Xcode is quite new to me so explanations are appreciated. I am looking to build an application that displays annotations in a mapview (zoomed in on current user location). I want the applications to come from some sort of database rather than manually inputting all the annotations (which is what I'm currently doing) What would be my application type? tab based? window based? i want a tab for a tableview with a list of my annotations and a mapview tab that will show my database of annotations but with the map zoomed in on current location. In a perfect world, it would be great if the user could add favourites from these annotations and keep them in a favourites tableview tab. I'm desperate to work this out and create a fully functional app for a final uni project. i have a working application already but it's nothing like what i am trying to achieve, any help would be much appreciated!!!! Jon (if looked through countless tutorials and as of yet found nothing i can understand to achieve a project like this. Some would call me too ambitious, I just want to make a decent app)

    Read the article

  • Mapkit +closest annotation

    - by danskcollignon
    Hi all, I am trying to devellopp an app showing the nearest poi to the users location. My app is now capable of: showing a map (Mapkit) with 110 annotations and the user's location. Furthermore, I have a TableView at the bottom of my screen, to choose between the different annotations. However, they're listed by number, and not by proximity to the user's location, which is my wish. My research have led me to think that I should use CLLocation for getting the user's location. I then have really no idea on how to do it next, using getDistancefrom. My annotations are stored on SecondViewController.m, using this form: -(void)loadOurAnnotations { CLLocationCoordinate2D workingCoordinate; workingCoordinate.latitude = XX.XXXXX; workingCoordinate.longitude = XX.XXXXX; SecondViewAnnotation *POI1 = [[SecondViewAnnotation alloc] initWithCoordinate:workingCoordinate]; [POI1 setTitle:@"POI"]; [POI1 setSubtitle:@"StreetName"]; [POI1 setAnnotationType:SecondViewAnnotationTypePOI1]; [mapView addAnnotation:POI1]; , and so on to POI110. Could someone please give me a clue? I'm a total newbie! Thank you in advance for your help,

    Read the article

  • Editing and iPhone SDK Framework ?

    - by Chris
    I am working with MapKit and want to be able to add a (NSString *)itemTag value to each of my annotations. I have created myAnnotiation.m and myAnnotation.h I tried adding itemTag to the myAnnotation.h/m but when I try to access currentAnnotation.itemTag within my main code, it says "itemID not found in protocols" - so I went to the MapKit.Framework and into MKAnnotation.h. I added (NSString *)itemID, but when I save the .h file in the Framework, it changes the file's icon and doesn't appear to by jiving with everything else. Any help or links to help would be greatly appreciated. I am not even sure if I'm on the right path here, but Googling "modify iphone sdk framework" does not turn up much.

    Read the article

  • Showing a MKAnnotation for custom object

    - by Chamanhm
    I have a list of objects and each of those has a title, name, description, latitude, longitude and address. Is it possible to show this objects as MKAnnotations? I've been stuck with this for hours now. When I tried to make the objects have a CLLocationCoordinate2D I kept getting the error about latitude or longitude not being assignable. #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface Oficina : NSObject <MKMapViewDelegate> @property (nonatomic, readwrite) CLLocationCoordinate2D oficinaCoordinate; @property (nonatomic, strong) NSString *oficinaCiudad; @property (nonatomic, strong) NSString *oficinaEstado; @property (nonatomic, strong) NSString *oficinaTitulo; @property (nonatomic, strong) NSString *oficinaTelefono; @property (nonatomic, strong) NSString *oficinaLatitud; @property (nonatomic, strong) NSString *oficinaLongitud; @property (nonatomic, strong) NSString *oficinaID; @property (nonatomic, strong) NSString *oficinaDireccion; @property (nonatomic, strong) NSString *oficinaHorario; @property (nonatomic, strong) NSString *oficinaTipoDeOficina; @property (nonatomic, strong) NSString *oficinaServicios; @property (nonatomic, strong) NSString *oficinaTipoDeModulo; @end So after consuming an internet service I get around 70 of these objects. Now I want to be able to turn each of those into a map annotation. This is one of the ways I've tried to assign the latitude but I get the error "Expression not assignable".. currentOffice.oficinaCoordinate.latitude = [parseCharacters floatValue]; Where currentOffice is an instance of my custom object.

    Read the article

< Previous Page | 1 2 3 4 5 6 7  | Next Page >