mapkit

A MapKit for Mac OS X?

主宰稳场 提交于 2019-11-29 02:26:41
问题 on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X? If possible something more advanced than a simple WebView, because I need that it manage automatically at least: annotations the user interaction the zoom in/out an overlay view (Even if the maps are not from Google is ok.) Thank you very much! 回答1: Update 2 MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference. Update - pulled from my comment below The situation has changed and there

Offline MapKit solution for iOS

南楼画角 提交于 2019-11-29 01:30:00
问题 Quick question for you. I have an app that I'm working on that will require the use of maps, but will not have a network connection. I have seen others ask similar questions about this, but my requirements are a slight bit different, so I wanted to post a new question. Here are my requirements for the app. Allow pinch/zoom of a map with definable annotations Map must be available offline Map should be restricted to a certain geo area App does not have to pass Apple inspection. This is an

Swift - Custom MKPointAnnotation with Image

旧城冷巷雨未停 提交于 2019-11-29 01:15:54
问题 I am trying to create a custom MKPointAnnotation to use on a map view. It looks very much like the one used in Apple's Photos: I will be retrieving a number of photos from a server, along with their location. I then want to display an annotation like the one above, with the image inside the annotation. I currently have a program that can add a normal MKPointAnnotation at the right coordinate, and can also retrieve the relevant photo from the server. All I want is to style my MKPointAnnotation

get tapped coordinates with iphone mapkit

倾然丶 夕夏残阳落幕 提交于 2019-11-29 00:57:23
问题 I'm making an app using apple's mapkit framework. What I want to do is to get longitude and latitude from a location that you press. I get the coordinates from the users current location using this code: - (IBAction)longpressToGetLocation:(id)sender { CLLocationCoordinate2D location = [[[self.mapView userLocation] location] coordinate]; NSLog(@"Location found from Map: %f %f",location.latitude,location.longitude); } How do I get that code to show the pressed location instead of userlocation?

How do I determine if a coordinate is in the currently visible map region?

こ雲淡風輕ζ 提交于 2019-11-29 00:43:24
I have a list of several hundred locations and only want to display an MKPinAnnotation for those locations currently on the screen. The screen starts with the user's current location with a 2 mile radius. Of course, the user can scroll, and zoom on the screen. Right now, I wait for a map update event, and then loop through my location list, and check the coordinates like this: -(void)mapViewDidFinishLoadingMap:(MKMapView *)mapView { CGPoint point; CLLocationCoordinate2D coordinate; . . . /* in location loop */ coordinate.latitude = [nextLocation getLatitude]; coordinate.longitude =

Opening native google maps in Xcode

拈花ヽ惹草 提交于 2019-11-28 22:10:53
Hi I have an iPhone application using maps and locations. I would like the user to be able to press a button that gives turn by turn directions to that location. I understand that i am not allowed to do this in app, but i was wondering if anyone could tell me if it is possible to make a link to the native google maps application that will enter directions to the location from the users current location. If it is possible could you also tell me how? any help would be appreciated. Thanks Sure, it's possible - you've just got to tell the system to open a google maps link, with parameters for the

Add inverted circle overlay to map view

陌路散爱 提交于 2019-11-28 20:50:47
(Using iOS 5 and Xcode 4.2.) I've followed the instructions here: http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/LocationAwarenessPG/AnnotatingMaps/AnnotatingMaps.html#//apple_ref/doc/uid/TP40009497-CH6-SW15 and used the MKCircle and MKCircleView classes to add a circle overlay on my MKMapView . However what I actually want is an inverted circle overlay, like the left map in the sketch below (currently I have a circle overlay like the one on the right): For the inverted circle, the overlay should cover the entire map - apart from the visible circle. Is there an

MapKit (MKMapView): zPosition does not work anymore on iOS11

不问归期 提交于 2019-11-28 18:50:05
On iOS11 the zPosition stopped working for the annotationView.layer. Every time the map region changes. No luck with original solution: layer.zPosition = X; No luck with bringViewToFront / SendViewToBack methods Xcode 8.3/9 UPDATE (SOLUTION thanks Elias Aalto): When creating MKAnnotationView: annotationView.layer.zPosition = 50; if (IS_OS_11_OR_LATER) { annotationView.layer.name = @"50"; [annotationView.layer addObserver:MeLikeSingleton forKeyPath:@"zPosition" options:0 context:NULL]; } In MeLikeSingleton or whatever observer object you have there: - (void)observeValueForKeyPath:(NSString *

display route on iOS 7 maps: addOverlay has no effect

旧巷老猫 提交于 2019-11-28 18:22:27
i want display a point to point route inside my mapView, i use this code for create the route: - (IBAction)backToYourCar { MKPlacemark *sourcePlacemark = [[MKPlacemark alloc] initWithCoordinate:self.annotationForCar.coordinate addressDictionary:nil]; NSLog(@"coordiante : locationIniziale %f", sourcePlacemark.coordinate.latitude); MKMapItem *carPosition = [[MKMapItem alloc] initWithPlacemark:sourcePlacemark]; MKMapItem *actualPosition = [MKMapItem mapItemForCurrentLocation]; NSLog(@"coordiante : source %f, ActualPosition %f", carPosition.placemark.coordinate.latitude ,actualPosition.placemark

Swift - CLGeocoder reverseGeocodeLocation completionHandler closure

只愿长相守 提交于 2019-11-28 18:19:46
What I'm trying to do is pass a CLLocation to the function getPlacemarkFromLocation which then uses the passed CLLocation through reverseGeocodeLocation to set the CLPlacemark? that will be returned. I'm having issues creating the completionHandler closure in reverseGeocodeLocation , it's throwing a compiler error/crash: In Swift, CLGeocodeCompletionHandler is CLGeocodeCompletionHandler = (AnyObject[]!, NSError!) -> Void according to the documentation AnyObject[]! is supposed to contain CLPlacemark objects just like the Objective-C version. Here's my current code: class func