mapkit

Moving annotations in MKMapView according to server data (latitude and longitude)

被刻印的时光 ゝ 提交于 2019-12-31 00:48:28
问题 In my app I am showing location of some other person by getting their location (latitude and longitude) from server at particular interval. After getting I have to remove all annotations and drop new annotations based on the server data. But it looks very inefficient as when we have the annotation for the same user previously exists even then I'm removing and adding the same user annotation. So I want to know can we move the MKAnnotation from one coordinate to other? I have tried

How to add two or more buttons to annotationView: MKAnnotationView?

僤鯓⒐⒋嵵緔 提交于 2019-12-30 11:02:09
问题 I want to have a MKAnnotationView to my pins on map (using MapKit) with next attributes: 1) image 2) details button 3) another details button 4) another details button? I have done actually adding image and details button with next code: annotationView.detailCalloutAccessoryView = snapshotView // snapshot view is a custom view // with image and its constraints let detailsButton = UIButton(type: .detailDisclosure) annotationView.rightCalloutAccessoryView = detailsButton So, the question is how

iOS overlay (MKPolygon) data for all U.S. states?

给你一囗甜甜゛ 提交于 2019-12-30 09:22:45
问题 In the Displaying Overlays on a Map section of the iOS Developer Library Location Awareness Programming Guide, there is an example that "shows a filled and stroked overlay covering the state of Colorado." // Define an overlay that covers Colorado. CLLocationCoordinate2D points[4]; points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116); points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066); points[2] = CLLocationCoordinate2DMake(36.993076, -102.041981); points[3] =

iOS overlay (MKPolygon) data for all U.S. states?

China☆狼群 提交于 2019-12-30 09:22:26
问题 In the Displaying Overlays on a Map section of the iOS Developer Library Location Awareness Programming Guide, there is an example that "shows a filled and stroked overlay covering the state of Colorado." // Define an overlay that covers Colorado. CLLocationCoordinate2D points[4]; points[0] = CLLocationCoordinate2DMake(41.000512, -109.050116); points[1] = CLLocationCoordinate2DMake(41.002371, -102.052066); points[2] = CLLocationCoordinate2DMake(36.993076, -102.041981); points[3] =

Can I use my own tiles in MapKit, instead of Google's?

别等时光非礼了梦想. 提交于 2019-12-30 05:30:10
问题 I'm currently trying to decide wether to accept a client's proposal or not. Basically, I'm asked to create a MapView that displays markers at several locations on a map, with the additional requirement that the client's own map tiles are used instead of Google Maps'. I do not know yet how the client stores their own map tiles, but I was assured that I'd be able to convert them into any format I'd need. Is it possible to use different map tiles in MapKit's MapView? Do you have good online

How to fill outside overlay circle in iOS 7 on map

我的未来我决定 提交于 2019-12-30 05:17:05
问题 I need the same filled space around circle on the map as in Reminders app in iOS7. I think need to use the method applyFillPropertiesToContext:atZoomScale or fillPath:inContext: . 回答1: I solved my problem: - (void)drawMapRect:(MKMapRect)mapRect zoomScale:(MKZoomScale)zoomScale inContext:(CGContextRef)context { // Fill full map rect with some color. CGRect rect = [self rectForMapRect:mapRect]; CGContextSaveGState(context); CGContextAddRect(context, rect); CGContextSetFillColorWithColor(context

Zoom in on User Location- Swift

£可爱£侵袭症+ 提交于 2019-12-30 05:03:32
问题 I can't figure out how to get the map to zoom in on the user location from viewDidLoad. I tried setting a region, and that didn't work. This is the code I have, any tips? @IBOutlet weak var mapView: MKMapView! var MapViewLocationManager:CLLocationManager! = CLLocationManager() var currentLocation: PFGeoPoint! = PFGeoPoint() override func viewDidLoad() { super.viewDidLoad() self.mapView.showsUserLocation = true mapView.delegate = self MapViewLocationManager.delegate = self mapView

What is proper way to get ETA (estimated time arrival) from any location to my current location

 ̄綄美尐妖づ 提交于 2019-12-30 03:16:05
问题 Would like to know what is proper way to get ETA (estimated time arrival) from any location to my current location, in consideration the following situation: a. ex. - I got from another device its location (lon/lat) and want to when the other person will pick me up... In this case what web-service can I use to get this info for the user? Does mapkit provides that kind of option? b. In case it will be done on the server-side and I'll just send my user location, what are the tools my server

how to show multiple lines in MKAnnotation with autolayout?

ⅰ亾dé卋堺 提交于 2019-12-30 02:29:07
问题 i am using mapkit how i can multiple line in MKAnnotation view . Every annotation there has title and subtitle. how i show sub title with multiple line with the help of auto layout ? i found it's Answer .plz try my answer. we just need to do code in - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { } here i show the idea how to use autolayout with MKAnnotation . 回答1: extension for adding multiple lines: import MapKit // must import MapKit for

Clear MKMapView's cache of tiles?

こ雲淡風輕ζ 提交于 2019-12-30 02:25:50
问题 I'm working on an iPhone game that uses an MKMapView as the playfield. After only a couple of minutes of play the app inevitably starts to get sluggish and eventually crashes due to low memory. After digging around the culprit seems to be that the map view constantly demands more memory. The game requires a lot of zooming and panning of the map so I can only assume that the map's cache of tiles just keeps growing until it runs out of memory. Is there any way to force the map view to flush it