mapkit

Reverse Geocoding/MapKit on OSX?

江枫思渺然 提交于 2019-12-10 10:56:10
问题 the iPhone SDK provides with MapKit a simple solution for maps und reverse geocoding without any additional costs. Does anyone know if there is a similar Framework for Cocoa on OSX? I know that google maps is capable of that but as far as I know and understand I have to pay while using google maps in a commercial application? Thanks for your answers twickl 回答1: You won't have to pay as long as you don't use the quota. The api documentation is here : http://code.google.com/apis/maps

Google direction api request invalid in ios5

旧时模样 提交于 2019-12-10 10:49:52
问题 Here is my request: https://maps.googleapis.com/maps/api/directions/json?origin=49.276951,-123.128559&destination=49.277874,-122.912404&mode=transit&sensor=false The result is: { "routes" : [], "status" : "INVALID_REQUEST" } It worked before, but it does not work when i used it today. why is that? Note: it works fine when i change it to mode=walking 回答1: https://maps.googleapis.com/maps/api/directions/json?origin=49.276951,-123.128559&destination=49.261566,-123.138399&mode=transit&sensor

MKPolygon - How to determine if a CLLocationCoordinate2D is in a CLLocationCoordinate2D polygon?

假装没事ソ 提交于 2019-12-10 10:45:42
问题 I have the swift code below that draws a polygon and drops an annotation on MKMapView. I am trying to figure out how i could identify if the annotation's coordinate is within the polygon? import UIKit import MapKit class ViewController: UIViewController { @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() { super.viewDidLoad() let initialLocation = CLLocation(latitude: 49.140838, longitude: -123.127886) centerMapOnLocation(initialLocation) addBoundry() var annotation =

Reachability and International Roaming

痴心易碎 提交于 2019-12-10 10:44:10
问题 I am using the Reachability class from Apple to determine whether or not data or wifi is available. However, a user (with a U.S. iPhone) is testing the app in another country and he is seeing the following error while trying to access the MapKit. Console In my research on this error, I have found that PBRequester is ProtocolBuffer . 2012-10-15 21:16:00.921 WrightsCS App[24239:907] PBRequester failed with Error Error Domain=kCFErrorDomainCFNetwork Code=-1018 "International roaming is currently

Calculating driving distance in iPhone

末鹿安然 提交于 2019-12-10 10:15:46
问题 I need to find the driving distance between 2 locations. I do not need to display the directions in a map, just need to calculate the distance, which I need to use in my application. Does MapKit allow this? Is there an alternative that can be used? I am able to get forward geo-coding using CloudMade, but there doesn't seem to be an option to obtain driving distance. Appreciate any help. 回答1: CloudMade also offers driving directions. If you are only interested in the distance, simply ignore

How to adjust region to fit custom annotation callout that have just appeared?

混江龙づ霸主 提交于 2019-12-10 09:45:26
问题 I use my custom subclass of MKAnnotationView. In mapView:didSelectAnnotationView: method of my Map's delegate I call the method of this class, which adds UIImageView with an image as a subview - it serves as my custom annotation callout. When using default MKPinAnnotationView map does automatically adjust map region to display the annotation callout that have just appeared. How can I implement this behavior using custom MKAnnotationView subclass? 回答1: Current solution I've crafted demo

iOS: How to convert MKMapPoint or CLLocationCoordinate2D to UTM?

人盡茶涼 提交于 2019-12-10 09:19:15
问题 From what I have read this takes some complicated Math that I am not good at. So, I am asking here. Does anyone have experience converting a MKMapPoint or CLLocationCoordinate2D to a UTM value? I found this resource (http://www.uwgb.edu/dutchs/usefuldata/UTMFormulas.HTM) but the math is overwhelming. 回答1: You could use one lib to do that, or analyze the code of one lib to understand the algorithm and do it yourself. This is a c++ lib that does the job: http://geographiclib.sourceforge.net

Set current user location in iPhone simulator

只谈情不闲聊 提交于 2019-12-10 06:05:51
问题 Is there a way to set the current user location in iPhone simulator on Xcode 4?, I want the simulator to show a different location other than Cupertino. 回答1: Yes, from the simulator's menu choose Debug > Location > Custom Location... . 回答2: You can Simulate Location by selecting Product -> Debug -> Simulate Location and select Location option from Xcode tool. This is shown in following figure: 回答3: You can add GPX file to get the current location on simulator. 来源: https://stackoverflow.com

How to open callout of annotation on map automatically, when map first loads?

心不动则不痛 提交于 2019-12-10 04:38:45
问题 I have a navigation based application for the iPhone that I am working that allows the user to view a selection from a table, on a map. I have an annotation that pinpoints the user's selected location on the map. As per normal behaviour, if the user clicks on the annotation, a callout appears with the details about the location. No problems here. My question is, I'd like the callout to appear automatically from the annotation, once the user is taken to the screen containing the map, so that

Location permission check and authorization

两盒软妹~` 提交于 2019-12-10 04:23:05
问题 I want my program to display the users location on the map. It was working at first then randomly stopped so i added the code below to try to fix it but I'm having problems. Thanks in advance! override func viewDidLoad() { super.viewDidLoad() self.locationManager.delegate = self self.locationManager.desiredAccuracy = kCLLocationAccuracyBest if CLLocationManager.locationServicesEnabled() { let status: CLAuthorizationStatus = CLLocationManager.authorizationStatus() if status ==