mapkit

How to add touch gesture to map but ignore touches on pins and annotations?

送分小仙女□ 提交于 2019-11-30 04:18:51
问题 I have a mapview that uses MKCircle s to display radius information for certain user actions. What I want to do, is allow the user to dismiss the MKCircle when they touch the map. However, I would like the MKCircle to NOT dismiss should the user touch any of the other pins or the MKCircle itself. Any ideas? Here is my current code, which dismisses the MKCircle when any part of the map is touched: UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:

Animating an MKOverlayView

|▌冷眼眸甩不掉的悲伤 提交于 2019-11-30 04:14:17
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. swap images) at the exact same time? I solved this by adding a UIImageView as a subview of the

Swift - Custom MKPointAnnotation with Image

被刻印的时光 ゝ 提交于 2019-11-30 04:05:32
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 to look just like that. I have tried following other answers but I think this is slightly different

How set Custom Annotation markers ( animated rings around a point) on GMSMapView

怎甘沉沦 提交于 2019-11-30 04:00:49
Using Google maps iOS SDK I have implemented a mapView in that i have created markers as follows // Creates a marker in the center of the map. GMSMarker *marker = [[GMSMarker alloc] init]; marker.position = CLLocationCoordinate2DMake(-33.86, 151.20); marker.title = @"Sydney"; marker.snippet = @"Australia"; marker.icon = [UIImage imageNamed:@"point1.png"]; marker.map = mapView_; But i need to Display animated images ie some sequence of images to display, animated rings around a point, instead of original GMSMarker sequence of images are point1.png point2.png point3.png point4.png point5.png Can

Offline MapKit solution for iOS

梦想的初衷 提交于 2019-11-30 03:54:46
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 enterprise app that will serve as a kiosk. So, is there any framework or method of caching map tiles that

get tapped coordinates with iphone mapkit

拟墨画扇 提交于 2019-11-30 03:18:57
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? jcesarmobile First of all, use a UIGestureRecognizer instead an IBAction - (void)longpressToGetLocation

Grouped/Ungroup MKAnnotation depending on the zoom level (And keep it fast)

情到浓时终转凉″ 提交于 2019-11-30 00:44:50
I have a mapview that has a lot of annotations, most of them are very close to each other. What I want to do is similar to the Photo app on iOS where annotations are grouped when they are too close to each other and whenever you zoom out, they un grouped if they are too far apart. I have seen this question already but the answer given isn't really what I was looking for. I'm looking for either a library or a algorithm that I could implement myself. Aurelien Porte Have a look here in order to see the full answer. It contains both implementations for MapKit and Google Maps. The code is inspired

tableview sort by distance swift

眉间皱痕 提交于 2019-11-29 23:59:09
问题 I build a view mix with map view and table view,I hope I can sort the cell by the distance from user location, I try to use the distanceFromLoaction method, but it shows that CLLocationCoordinate has no member distanceFromLocaiton, is there another way to do it or fix it? this is my array structure import UIKit import MapKit class tripSpot: NSObject, MKAnnotation{ var title: String? var coordinate: CLLocationCoordinate2D var regionRadius: Double var location: String? var type: String? init

Custom map style in MapKit

左心房为你撑大大i 提交于 2019-11-29 23:18:31
I am looking for a way to implement a custom map style in iOS 7, just like you can do with Google Maps . I have found some posts saying that this is not possible with MapKit, but they are all posted a while back. To clarify, by style I am talking about custom colors and preferably also fonts. Example of custom Google Map style below. (source: servendesign.com ) I would really prefer using MapKit for performance reasons, but if it is not supported I am open to using other frameworks as well. The ones that I have seen are MapBox and Cloudmade, and of course the Google Maps SDK. Is there a way of

iPhone: Detecting Tap in MKMapView

ε祈祈猫儿з 提交于 2019-11-29 22:23:41
How do I detect a single tap on an instance of MKMapView ? Do I have to subclass MKMapView and then override the touchesEnded method? Thanks, -Chris tt.Kilew Hope this will help : How to intercept touches events on a MKMapView or UIWebView objects? pseudopeach If you're just looking to get notified of tap gestures without affecting any of the other touch behavior of the map, you'll want to use a UITapGestureRecognizer . It's super simple, just put in some code like this. UITapGestureRecognizer* tapRec = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(didTapMap:)];