mapkit

regiondidchange called several times on app load swift

好久不见. 提交于 2019-12-12 09:26:49
问题 I have a map that when i pan away or type in a location and navigate to it that I want a simple print function to run. I have this accomplished, however, when i first load the app it calls that print function several times until it is finished zooming in. Is there a way to NOT count the initial on app load region change? 回答1: answer finally found herehttp://ask.ttwait.com/que/5556977 private var mapChangedFromUserInteraction = false private func mapViewRegionDidChangeFromUserInteraction() ->

iPhone 3.0 MapKit - Multiple Annotations in the Same Location

∥☆過路亽.° 提交于 2019-12-12 09:25:28
问题 Background: I have created an application that allows users to submit an entry to an online database, and view other entries from that database. These entries contain geocodes for latitude and longitude which are used for positioning the annotations on the MapKit. Users can submit the location using either their current location or an address, which is then geocoded. Question: What is the proper or suggested method of handling annotations that fall on the exact same coordinates? I was

MKannotationView with UIButton as subview, button don't respond

空扰寡人 提交于 2019-12-12 09:15:08
问题 I have add a view with button as a subview to MKAnnotationView CCBigBubleViewController* buble = [[CCBigBubleViewController alloc] init]; [annotationView addSubView:buble.view]; It is shown perfectly, but the button does't respond to tapping. 回答1: In your implementation of MKAnnotationView, override the hitTest method: - (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event { if (CGRectContainsPoint(_button.frame, point)) { return _button; } return [super hitTest:point withEvent:event];

Looking for an MKOverlayPathRenderer example

半腔热情 提交于 2019-12-12 08:46:41
问题 I am trying to figure out how to use a new MKOverlayPathRenderer class. In my app I previously used MKOverlayPathView when building with iOS 6 SDK, but it does not seem to work with iOS 7 SDK unfortunately. So I am trying to move my app from MKOverlayPathView to MKOverlayPathRenderer , but have no success so far. MKPolylineRenderer works OK, but MKOverlayPathRenderer does not. The code gets called, but no overlay is drawn on a map. Does anybody have a working example for MKOverlayPathRenderer

iPhone 3.0 MapKit — providing routing between points

我只是一个虾纸丫 提交于 2019-12-12 07:38:11
问题 Is it possible to have the MapKit connect defined points using the Google Maps API type routing connections. 回答1: Unfortunately not — it's part of the SDK agreement that if you do routing, you have to use your own maps, like TomTom and the like have. 回答2: Unfortunately not — it's part of the SDK agreement that if you do routing, you have to use your own maps, like TomTom and the like have. I don't see this in the 3.1.2 SDK agreement. Reading sections 3.3.7 through 3.3.11, the only restriction

Initializing MKMapView starts with retain count 2

流过昼夜 提交于 2019-12-12 06:28:25
问题 I've added a MKMapView to my application, but when i allocate the map into the memory it starts with a retain count of 2 (i'm using iOS 4.0 as base SDK) MKMapView *x = [[MKMapView alloc] initWithFrame:CGRectMake(0, 0, 320, 370)]; NSLog(@"map retain count: %i", [x retainCount]); [self addSubview:x]; NSLog(@"map retain count: %i", [x retainCount]); [x release]; NSLog(@"map retain count: %i", [x retainCount]); [x removeFromSuperview]; NSLog(@"map retain count: %i", [x retainCount]); The output

Swift: How can I make less didupdatelocation calls

99封情书 提交于 2019-12-12 06:05:29
问题 I've come up with some code that prints the address and postalcode of my location. This is done in the didupdatelocation function. The only problem that I occur, is that every second this address get's updated by the "didupdatelocation" function. Because this is very battery ineffecient, I was looking for ways to use an interval but I couldn't find ways (also not on Google en stackoverflow) on how to do this. Can anybody give me tips how I can do this in Swift? 回答1: The answers of Rajeshkumar

Stuck with ObjC and MapKit CoreLocation

你。 提交于 2019-12-12 05:49:27
问题 I've been getting into mapkit and corelocation for ios. I'm just trying to display a map and zoom in on my current location for now. I can draw the map, with my location. I can get my current location. I just can't get the location data into the map method. I'm a bit of a noob, but thought I knew what I was doing up until this point! :) Any help is appreciated. My code is here, which sort of works but plonks me in the middle of the Atlantic at 0 long and 0 lat! - (void)viewDidLoad { [super

Annotations dont show title/subtitle on MapKit , iOS

荒凉一梦 提交于 2019-12-12 05:38:41
问题 I am parsing some data with some points of interests and trying to show them on map using the MapKit framework. I created a custom class for my objects on the map which i call MyLocation. MyLocation.h: #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface MyLocation : NSObject <MKAnnotation> { NSString *_name; NSString *_address; NSInteger _eventId; CLLocationCoordinate2D _coordinate; NSString *title; NSString *subtitle; } @property (nonatomic , copy) NSString *name;

iOS 8 Maps App replica

筅森魡賤 提交于 2019-12-12 04:54:15
问题 According to Apple MapKit view documentation "...An MKMapView object provides an embeddable map interface, similar to the one provided by the Maps application ..." Here is screenshot of Maps application I was digging through MapKit but can't find how to replicate this presentation. Or it's not an MKMapView on the screenshot? Update Sure, I'm talking about globe view only. 回答1: The 3D globe view in Maps.app is not yet available in MapKit. You only get 2D and 3D tilted but flat maps. 来源: https: