mapkit

How to integrate new Google map app with ios app

假如想象 提交于 2020-01-12 20:27:48
问题 Google Map is now available in Appstore for IOS 6. I have a application which utilises MAPKIT and WebView to show Driving direction using Google webservices. For showing Route in Native Apple MAP app, i use codes similar to this.. MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place]; NSDictionary *options = @{ MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving }; [mapItem openInMapsWithLaunchOptions:options]; I want to show Route to the user in the New Google MaP

Dotted line on map view

拟墨画扇 提交于 2020-01-12 13:47:01
问题 I can create a line between two points fairly easy with the below code (part of it anyways) How could I make the line dotted instead of solid? Also would it be possible to change the opacity the longer the line is? - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay { MKPolylineRenderer *renderer =[[MKPolylineRenderer alloc] initWithPolyline:overlay]; renderer.strokeColor = [UIColor orangeColor]; renderer.lineWidth = 3.0; return renderer; } 回答1:

Dotted line on map view

好久不见. 提交于 2020-01-12 13:46:07
问题 I can create a line between two points fairly easy with the below code (part of it anyways) How could I make the line dotted instead of solid? Also would it be possible to change the opacity the longer the line is? - (MKOverlayRenderer *)mapView:(MKMapView *)mapView rendererForOverlay:(id < MKOverlay >)overlay { MKPolylineRenderer *renderer =[[MKPolylineRenderer alloc] initWithPolyline:overlay]; renderer.strokeColor = [UIColor orangeColor]; renderer.lineWidth = 3.0; return renderer; } 回答1:

iOS 6 Map problems with MKUserTrackingModeFollowWithHeading

时间秒杀一切 提交于 2020-01-12 08:47:26
问题 I'm trying to solve two problems with MKUserTrackingModeFollowWithHeading in iOS 6: MKUserTrackingModeFollowWithHeading works briefly, but it's jittery and returns to MKUserTrackingModeFollow almost immediately, especially at high zoom levels. The app occasionally crashes when repeatedly changing the MKUserTrackingMode : I get EXC_BAD_ACCESS on the main thread, without further information. This is hard to reproduce, but it has happened repeatedly. Any thoughts on what might be causing this?

Turning user location annotation with heading

我只是一个虾纸丫 提交于 2020-01-12 08:40:12
问题 I'm trying to change the User Annotation in my app so that it shows the usual blue dot, but with a triangle coming off of it to show which direction the user is facing (I'd rather rotate the user annotation than the entire map, which is what MKUserTrackingModeFollowWithHeading does). I've got a rudimentary version working, but it has some weird behavior. First, some code: -(MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id<MKAnnotation>)annotation { if ([annotation

MKAnnotationView with custom view and image view

本小妞迷上赌 提交于 2020-01-12 08:39:31
问题 In my Map application, instead of showing a pin, I want to show a colored background circle with image in it. The color of the background (which is shade of green in below image) circle is dynamic. It will look as in below image: I created TCircleView which draws the color in "drawRect" To show similar annotation, I created object of TCircleView and UIImageView and add them to MKAnnotationView object. Its looking good and visible as expected. But its not allowing to detect tap/touch to show

How do I create an image overlay and add to MKMapView in Swift 2?

杀马特。学长 韩版系。学妹 提交于 2020-01-12 08:09:31
问题 I am trying to learn MapKit and am now trying to add an image (not a polygon, circle, rectangle, etc.) as an overlay to the map view. I can't seem to find any sample code to help explain how to do this. So far my code in ViewController.swift is: import UIKit import MapKit import CoreLocation class ViewController: UIViewController, MKMapViewDelegate, CLLocationManagerDelegate { @IBOutlet var mapView: MKMapView! var locationManager: CLLocationManager! var mapOverlay: MKOverlay! override func

Putting UIButton and other UIControl objects inside an MKAnnotationView and allowing user interaction

牧云@^-^@ 提交于 2020-01-12 07:37:05
问题 I have a custom annotation view on the map, which has a UIButton in it, but the UIButton is not responsive when pressed. I have two main problems with user interaction on the annotation view: Buttons and other controls are not responsive. I want the annotation to block touches according to my implementation of - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event - that is if I return YES then I don't want the touches to get sent through to the MKMapView (potentially selecting other

Tilt map in Mapkit programmatically using Swift

一个人想着一个人 提交于 2020-01-11 10:12:32
问题 I'd like to tilt the map at startup. (Same as the user does when scrolling up or down with 2 fingers) Is this possible using Swift? 回答1: MKMapView Class Reference : http://goo.gl/djHXPn Look at the camera property : A camera object defines a point above the map’s surface from which to view the map. Applying a camera to a map has the effect of giving the map a 3D-like appearance. You can use a camera to rotate the map so that it is oriented to match the user’s heading or to apply a pitch angle

Longer subtitles in MapView annotations (swift)

廉价感情. 提交于 2020-01-11 06:58:10
问题 I have a mapView with annotations displaying titles and subtitles. The subtitles are sometimes longer than the width of the annotation, so I am wondering if i can make them multiline? It's coded like this so far: func annotate(newCoordinate, title: String, subtitle: String) { let annotation = MKPointAnnotation() annotation.coordinate = newCoordinate annotation.title = title annotation.subtitle = subtitle self.map.addAnnotation(annotation) } Then i have a few options set in func mapView