mapkit

Animate a visual element along an arc in MapKit

一个人想着一个人 提交于 2019-12-04 07:15:49
How do I add and animate a visual element along an arc, which I have created inside mapkit ? The following code will create a nice arc between two points. Imagine an animated visual that will represent an airplane flying along this arc. -(void)addArc { CLLocationCoordinate2D sanFrancisco = { 37.774929, -122.419416 }; CLLocationCoordinate2D newYork = { 40.714353, -74.005973 }; CLLocationCoordinate2D pointsArc[] = { sanFrancisco, newYork }; // MKGeodesicPolyline *geodesic; geodesic = [MKGeodesicPolyline polylineWithCoordinates:&pointsArc[0] count:2]; // [self.mapView addOverlay:geodesic]; } The

Try to load a created Map in MKMapView

假如想象 提交于 2019-12-04 07:13:13
问题 I am trying to load my Map which I created with a kml File in Google-Maps. The Google Maps Link. I have to say it is only an example, but it is the same principle. The easiest way is to load in a WebView, but that is ugly in my eyes. Thank you for reading my Question! Best regards CTS 回答1: To load a KML into a MKMapView : Add the necessary frameworks ( MapKit.framework and CoreLocation.framework ) to your target; Load and parse the KML; Create your annotations on the basis of the KML; and Set

Subclasses of MKAnnotationView

99封情书 提交于 2019-12-04 06:59:17
I was wondering if anyone knows of any subclasses for the MKAnnotationView class. On apples documentation they say one example is the MKPinAnnotationView so I was wondering if there were other pre-created subclasses like the one used to track the devices current location. If anyone has tips for creating my own subclass of the MKAnnotationView class that be great as well. Thanks, bubster I don't know of any other templates, but that does not mean that they don't exist. :) Anyway, here's how to create custom ones: Create a new class conforming to the MKAnnotation protocol. You will need to have

Adding a button to MKPointAnnotation?

佐手、 提交于 2019-12-04 06:10:21
问题 I just wrote few lines of code and got stuck trying add a detail button to my annotation point, I don't know how. Does anyone know how to do that? The image below shows what I want to achieve. Thanks! http://i.stack.imgur.com/kK1Ox.jpg Im trying to get the big i in the circle in my annotation. Right now I just have an annotation with a title and a subtitle, which looks like below. http://imgur.com/L3VMe5l.png Also, if you know, when a user clicks on the i in the circle, how do i bring them to

How to integrate new Google map app with ios app

£可爱£侵袭症+ 提交于 2019-12-04 06:10:01
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 App installed on user device, embeed its UI within a View in my app. Do guide me. Goole have released

Multiple Annotations ( MKAnnotationView ) in the same location Coordinates

一个人想着一个人 提交于 2019-12-04 05:59:17
Hi I am trying to implement Annotations grouping and animation if the user touch. I did look a the different cluster Library solution but this wont work for my because I have multiple Annotations in the same Coordinates. So this is what I want to do 1- I identify where there are multiple Annotations in the same place (Coordinates)? how can implement this ? find the annotations in the same coordinates and make a new group annotation ? 2- change the colour of that Annotation (to let the user know) I can do this on this method -(MKAnnotationView*)mapView:(MKMapView *)mapView viewForAnnotation:(id

Adding a custom annotation to a MKMapview

℡╲_俬逩灬. 提交于 2019-12-04 05:51:14
问题 I am trying to add annotations to a MKMapView I have created a class CustomMapPin which conforms to the MKAnnotation protocol #import <Foundation/Foundation.h> #import <MapKit/MapKit.h> @interface CustomMapPin : NSObject <MKAnnotation> { CLLocationCoordinate2D coordinate; NSString *title; NSString *subtitle; } @property(nonatomic, assign) CLLocationCoordinate2D coordinate; @property(nonatomic, copy) NSString *title; @property(nonatomic, copy) NSString *subtitle; @property(nonatomic, strong)

Why clusterAnnotationForMemberAnnotations in MKMapView is not called?

北城余情 提交于 2019-12-04 05:49:19
问题 I have a simple map view: @IBOutlet private var mapView: MKMapView! Then one by one I add annotations: mapView.addAnnotation(Annotation(user: user)) and show them all: mapView.showAnnotations(mapView.annotations, animated: true) I also implemented the method: func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation { print(memberAnnotations) return MKClusterAnnotation(memberAnnotations: memberAnnotations) } but this is

Check if user location is visible on map iphone

拥有回忆 提交于 2019-12-04 05:37:04
I want to hide or show a UIButton weather user's current location is visible on map. While testing the code xcode I can see meassage "User location view is NOT visible but should be. Showing...." on console in "didUpdateLocation" method if users location is not visible on map. How can I use this message to generate events in my case to hide or show a UIButton? Thanks for any help in advance. If you want to know whether the user location is contained in the currently displayed map region, you can check the userLocationVisible property in the regionDidChangeAnimated delegate method: - (void

MKTileOverlay with Retina-Tiles

风流意气都作罢 提交于 2019-12-04 05:36:06
I have issues to load 512x512px tiles in MKMapKit. The Server provides 512x512 .jpeg tiles. I could not find any solution or sample implementation for custom retina tiles in MKMapView. What I do: When I load them into MKMapView with overlay = [[MKTileOverlay alloc] initWithURLTemplate:template]; overlay.tileSize = CGSizeMake(512.0f, 512.0f); [_mapView insertOverlay:overlay atIndex:MAP_OVERLAY_INDEX_TILE level:MKOverlayLevelAboveLabels]; … tiles are scaling correct but only half of them is loaded (not only visually - i sniffed the requests and the tiles are missing) with overlay = [