mapkit

Extending iOS KMLViewer Sample to Handle KML NetworkLink Elements

谁说我不能喝 提交于 2019-12-22 12:32:26
问题 I am developing an iOS app that displays KML data over an MKMapView. Apple's KMLViewer sample app has gotten me started. Unfortunately, the KML data I am using relies heavily on linked files via the NetworkLink , Link and href KML elements, and KMLViewer's parser doesn't handle those. I can probably figure out how to add such support, but before I go down that road I was wondering if anyone else has already done this, or if there is a better starting point than KMLViewer. I've looked at

Custom MKMapView callout not responding to touch events

别说谁变了你拦得住时间么 提交于 2019-12-22 11:28:52
问题 I have a custom UIView that I am displaying as a callout when the user clicks on a custom annotation on an MKMapView . To achieve this I have subclassed MKAnnotationView and overloaded the -setSelected:selected animated: method as suggested in this answer. Basically, I am adding my custom view as a subview of my MKAnnotationView subclass. The problem is that I can't interact with the callout, which contains a button and a scrollable webview, at all. What's more, if the callout hides an

Write data to plist

雨燕双飞 提交于 2019-12-22 10:44:49
问题 I would like to read data from a plist, add some elements and the write the data to a plist.(update a plist). I want to have the plist hold an array of dictionaries, read this array into my app, add dictionaries and then write the array back to the plist. How is this done? Im also not sure where and how to create the plist on the apps first launch. or should it be placed in the bundle from the beginning? Another thing I am not sure about is if the plist dictionaries can hold e.g. CLLocations

Transit MKDirectionsRequest produces null error Error Domain=MKErrorDomain Code=5 “(null)”

人盡茶涼 提交于 2019-12-22 10:21:48
问题 I'm trying to use the MapKit Directions Request to get transit directions between two coordinates. When I switch to other (non-Transit) types, the code below works, but when I switch to Transit, it throws an error that doesn't show up anywhere in Apple's documentation. The two locations (source and destination) are both in New York City so there should definitely be transit directions available. Error message: Error Domain=MKErrorDomain Code=5 "(null)" Code snippet: override func viewDidLoad(

Converting View Points to MKMapView Coordinates

笑着哭i 提交于 2019-12-22 10:20:05
问题 My objective is to convert the top left and bottom right points of my view to lat/lon coordinates. These lat/lon coordinates will be used to query annotation locations that only exist within the view (not all 5000+). I found this Objective-C tip on Stackoverflow. But the issue I have is that it is converting 0,0 from the mapView (a lat/lon of -180,-180. Aka, the Southpole). So instead of: topLeft = mapView.convertPoint(CGPointMake(0, 0), toCoordinateFromView: self.mapView) I figured I could

Move MKMapView point to pixel coordinates

我是研究僧i 提交于 2019-12-22 10:17:36
问题 I have a quick question. I am using a custom view as a callout accessory for my map view. I am having some issues with getting the annotation to move to the right bottom corner of the said view. I am currently trying to get the CGPoint coords of the selected annotation, but beyond that I've drawn a blank Any help would be greatly appreciated. The current code I'm using (I know it is incorrect is:) CGPoint bottomLeftPoint = CGPointMake(xOffset,[self.internalAnnotationCallout view].frame.size

How to add annotations to MKMapView asynchronously?

微笑、不失礼 提交于 2019-12-22 09:57:41
问题 I have a lot of annotations to be added to a mkmapview. When i add the annotations, the app freezes for a short period of time. I have understand that the main thread is the only thread allowed to add UI to view, if this is true, how to i make this operation not freeze the app? // in viewdidLoad for (NSManagedObject *object in requestResults) { CustomAnnotation *customAnnotation = [[CustomAnnotation alloc] init]; customAnnotation.title = object.title; customAnnotation.coordinate =

Obtaining MKAnnotation's coordinate while dragging

人盡茶涼 提交于 2019-12-22 09:39:02
问题 I'm creating a path (MKPolyline) based on the position of annotations added by the user. I want to allow the users to change the path by dragging the pins. I currently can do that, but the MKPolyline doesn't update until the pin is dropped. I implemented - (void)mapView:(MKMapView *)mapView annotationView:(MKAnnotationView *)annotationView didChangeDragState:(MKAnnotationViewDragState)newState fromOldState:(MKAnnotationViewDragState)oldState for the MKAnnotationViewDragStateDragging but it

MkMapview setRegion under ios6 snaps to grid like ios5, no precise setRegion possible

一世执手 提交于 2019-12-22 09:14:11
问题 It is well known that using setRegion with MkMapKit under ios5 snaps to the next available Google zoom level, so a precise programatic setting of the map region was not possible (without special tricks, like using transformation matrix on mapView) But for some strange reasons using setRegion or setMapRect under iOS 6.1.3 iphone4 shows the same behavior as in iOS5, although this works on ipad ios6.1.3. iphone4 and simulator can only use regions double or half size from the prevoius one. So

How I can solve Terminated due to Memory Error

拜拜、爱过 提交于 2019-12-22 06:24:20
问题 I am using MKMapView in my big project . when I load a lot annotation (over 700) and I draw line between those points on MapKit , I am getting xcode error message "Terminated due to memory error" and app is crashing . you can see on image: . I am adding line like this : if I have less than 700 annotation , it's working very well . I am thinking it's have some memory problem . How can I solve this problem ?any advice . // adding annodation for (int i=0; i<[fetcher.locations count]; i++)/