mapkit

iOS 8 MKAnnotationView rightCalloutAccessoryView misaligned

僤鯓⒐⒋嵵緔 提交于 2019-11-29 22:11:18
I'm still pretty new to the iOS stuff in general and found a problem while testing our App for iOS 8 compatibility. In iOS 7 everything worked fine but on iOS 8 the rightCalloutAccessoryView is misaligned under certain circumstances. First Screenshot: Correctly aligned Second Screenshot: Wrong alignment As you can see, the problem takes place when the InfoWindow has a long title. But this was not the case on iOS 7 and I couldn't find anything mentioning this has changed? I tried to understand why and find a way to resolve this, but couldn't find anything yet. Is this solvable on our own or do

Zoom to fit region for all annotations - ending up zooming in between annotations

僤鯓⒐⒋嵵緔 提交于 2019-11-29 22:02:46
问题 I have a problem with fitting all my annotations to the screen... sometimes it shows all annotations, but some other times the app is zooming in between the two annotations so that none of them are visible... I want the app to always fit the region to the annotations and not to zoom in between them... what do I do wrong? if ([mapView.annotations count] == 2) { CLLocationCoordinate2D SouthWest = location; CLLocationCoordinate2D NorthEast = savedPosition; NorthEast.latitude = MAX(NorthEast

Check whether zoom level changed

白昼怎懂夜的黑 提交于 2019-11-29 21:08:00
I'm using MapKit on iPhone. How can I know when the user changes the zoom level (zoom in\out the map)? I've tried to use mapView:(MKMapView *)mapView regionDidChangeAnimated:(BOOL)animated; but that's called even when the map is only dragged. Unfortunately, when the map is dragged the mapView.region.span changes as well... Help? 10x afarnham It is pretty simple to calculate the zoom level. See the snippet below. You can get the mRect parameter from the visibleMapRect property on your MKMapView instance. + (NSUInteger)zoomLevelForMapRect:(MKMapRect)mRect withMapViewSizeInPixels:(CGSize

Making the map zoom to user location and annotation (swift 2)

北慕城南 提交于 2019-11-29 18:50:29
问题 I am working with mapkit. I want the map to zoom to show the user's location and the annotated point, instead of just zooming to the user's current location. Currently I have: let annotation = MKPointAnnotation() annotation.coordinate = CLLocationCoordinate2DMake(mapLat, mapLon) annotation.title = mapTitle self.map.addAnnotation(annotation) func locationManager(manager: CLLocationManager, didUpdateLocations locations: [CLLocation]) { let userLoction: CLLocation = locations[0] let latitude =

custom annotation apple mapkit

青春壹個敷衍的年華 提交于 2019-11-29 17:08:44
I am trying to assign two custom annotations, one called "arsenal.png" and one called "chelsea.png" Using apple mapkit framework, xcode 7. Need assistance with code to achieve the customized markers. here is my implementation file: // TrucksViewController.m #import "TrucksViewController.h" #import "Annotation.h" @interface TrucksViewController () @end //Wimbledon Coordinates #define WIMB_LATITUDE 51.434783; #define WIMB_LONGITUDE -0.213428; //Stadium Coordinates #define ARSENAL_LATITUDE 51.556899; #define ARSENAL_LONGITUDE -0.106483; #define CHELSEA_LATITUDE 51.481314; #define CHELSEA

Custom Map using iPhone MapKit

纵然是瞬间 提交于 2019-11-29 15:19:48
问题 I am attempting to use MapKit to create a custom map (similar to this concept http://mapwow.com/) using an image instead of the google maps image. This is so we can include the gps functionality and the pins functionality. I have looked in the documentation and there does not appear to be a standard way of doing it. Is there a way to do this using MapKit or has someone found a way to achieve something similar? 回答1: You can't currently use anything other than the Google Maps with MapKit.

Issue with Map Annotation and MKMapView in iOS 4.2?

守給你的承諾、 提交于 2019-11-29 15:17:09
I have a map view with pins that when the user selects a pin it goes to a detail screen for that pin. I also have a table view that when the user selects an item it goes to the same type detail view. Here's the problem ... It seems to work fine in everything from 3.1.3 to 4.1. That is the detail view matches with the pin. But I have a user who just upgraded to iOS 4.2 and says that under 4.1 it worked fine, but in 4.2 the pin selection takes him to the detail for a different pin. But in the table view it still works fine. Is it possible that there was a change in MKMapView in iOS 4.2 that

iOS MKMapShapshotter completion block is not always being called

纵饮孤独 提交于 2019-11-29 13:43:42
I am trying to use the new iOS7 MKMapSnapshotter to generate a static map image. Whenever my app needs a map, I call the following: MKMapSnapshotter *snapshotter = [[[MKMapSnapshotter alloc] initWithOptions:theOptions] autorelease]; dispatch_queue_t aQueue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_BACKGROUND, 0); DebugLog(@"Snapshotter allocated %@ and run on queue %@", snapshotter, aQueue); [snapshotter startWithQueue:aQueue completionHandler:^(MKMapSnapshot *snapshot, NSError *error) { DebugLog(@"Snapshotter completion block %@", snapshotter); // perform selector on main thread to

Force MapKit use cached map tiles only/disable network programmatically

落花浮王杯 提交于 2019-11-29 12:39:41
问题 We have stumbled upon such a problem. We are developing an application for travelling. To make sure the user doesn't spend much money on roaming charges in our app we decided to implement a settings option for user to view cached maps only. So we let the user decide whether he wants to load the maps from internet or he wants to save money and view cached maps (stored in Library/Caches/MapTiles/MapTiles.sqlitedb). We can't find a way to implement this. Is there any way to disable network

iOS MapKit dragged annotations (MKAnnotationView) no longer pan with map

家住魔仙堡 提交于 2019-11-29 11:43:05
I'm learning to use MapKit in my fledgling iOS app. I'm using some of my model entities as annotations (added the <MKAnnotation> protocol to their header file). I also create custom MKAnnotationViews and set the draggable property to YES . My model object has a location property, which is a CLLocation* . To conform to the <MKAnnotation> protocol, I added the following to that object: - (CLLocationCoordinate2D) coordinate { return self.location.coordinate; } - (void) setCoordinate:(CLLocationCoordinate2D)newCoordinate { CLLocation* newLocation = [[CLLocation alloc] initWithCoordinate: