mapkit

How to launch another app from an iPhone app

ε祈祈猫儿з 提交于 2019-11-30 14:12:20
问题 I am working on a map application in my iPhone app. I have a button go . When the user clicks this button in this method I want to check if user has installed the waze application on his iphone. If yes then navigate to waze application otherwise open iPhone's default map app. 回答1: Try to do this way : NSString *wazeAppURL = @"waze://"; NSString *mapsAppURL = @"maps://"; BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:wazeAppURL]]; NSString *url =

Displaying Pin with Title (annotation) once map loads

别来无恙 提交于 2019-11-30 13:55:14
I am working on my first app and within it I'm just trying to have on button click show a map with a pin (and title on this pin of location). I was able to load the mapview and to have it show the coordinates I want. But when trying to display the pin and annotation I am having issues. Not sure where to code this and how to make annotation to display pin. I've searched and seen many tutorials, but most show a different mapview style and are showing pin on user selection, I want to show pin on load of map. Here is the code I have to show the map which is working, but has no pin display or

MKPointAnnotations touch event in swift

早过忘川 提交于 2019-11-30 13:21:56
I would like to know if anyone can tell me how I can touch a pin on the map in the form of MKPointAnnotations . I would like to click the pin on the map and go to another view by bringing back the variables of the pin that I have preset . Can anyone explain me this thing in Swift ? thanks Edit with code: class ViewController: UIViewController, MKMapViewDelegate { @IBOutlet weak var mappa: MKMapView! override func viewDidLoad() { super.viewDidLoad() var location : CLLocationCoordinate2D = CLLocationCoordinate2D(latitude: 44.648590, longitude: 10.918794) let pinAnnotation = PinAnnotation()

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

两盒软妹~` 提交于 2019-11-30 13:07:10
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 = userLoction.coordinate.latitude let longitude = userLoction.coordinate.longitude let latDelta:

Animating an MKOverlayView

房东的猫 提交于 2019-11-30 12:50:43
问题 I have an MKOverlayView that displays animated radar data as a series of images. The issue I have is that the radar images are chopped into tiles by MapKit. To swap images I have a timer that calls an update function which sets the current image in my overlay and then calls the following [myRadarOverlayView setNeedsDisplayInMapRect:self.mapView.visibleMapRect]; The overlay updates, but does so one tile at a time so I get a choppy animation. Any ideas about how make all the tiles animate (i.e.

iOS 8 MKAnnotationView rightCalloutAccessoryView misaligned

末鹿安然 提交于 2019-11-30 10:44:15
问题 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

Custom Map using iPhone MapKit

女生的网名这么多〃 提交于 2019-11-30 10:10:24
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? You can't currently use anything other than the Google Maps with MapKit. Dmytro has already pointed to useful links that provide alternatives, particularly the route-me library , but

Get Location From Center of Screen Swift MapKit

僤鯓⒐⒋嵵緔 提交于 2019-11-30 09:54:24
I'm new on Swift Programming, and I'm trying to build an app that I can get the coordinates of the center of the view with MapKit and Swift 2. I already can get the current location, but I need if I move on the map, the location set to the new point which will be the center of the screen. Can you help me with this please?. Regards, You can use the regionDidChangeAnimated delegate method and call mapView.centerCoordinate. It will look like the following: func mapView(mapView: MKMapView, regionDidChangeAnimated animated: Bool) { var center = mapView.centerCoordinate } Also make sure that your

Add different pin color with MapKit in swift 2.1

自闭症网瘾萝莉.ら 提交于 2019-11-30 09:24:38
问题 I'm new in Swift. I'm trying to have different color pin or custom pin on specific pin. My code works. I've a purple pin, but I want make a difference between them. How can I do it? I think there something to do in MapView delegate method but I didn't find it. import UIKit import MapKit class MapsViewController: UIViewController , MKMapViewDelegate{ var shops: NSArray? { didSet{ self.loadMaps() } } @IBOutlet weak var map: MKMapView? override func viewDidLoad() { super.viewDidLoad() loadMaps()

How to launch another app from an iPhone app

Deadly 提交于 2019-11-30 09:21:05
I am working on a map application in my iPhone app. I have a button go . When the user clicks this button in this method I want to check if user has installed the waze application on his iphone. If yes then navigate to waze application otherwise open iPhone's default map app. Try to do this way : NSString *wazeAppURL = @"waze://"; NSString *mapsAppURL = @"maps://"; BOOL canOpenURL = [[UIApplication sharedApplication] canOpenURL:[NSURL URLWithString:wazeAppURL]]; NSString *url = canOpenURL ? wazeAppURL : mapsAppURL; [[UIApplication sharedApplication] openURL:[NSURL URLWithString:url]]; Here,