mapkit

iOS MapKit dragged annotations (MKAnnotationView) no longer pan with map

梦想的初衷 提交于 2019-11-30 09:04:53
问题 I'm learning to use MapKit in my fledgling iOS app. I'm using some of my model entities as annotations (added the <MKAnnotation> protocol to their header file). I also create custom MKAnnotationViews and set the draggable property to YES . My model object has a location property, which is a CLLocation* . To conform to the <MKAnnotation> protocol, I added the following to that object: - (CLLocationCoordinate2D) coordinate { return self.location.coordinate; } - (void) setCoordinate:

Force MapKit use cached map tiles only/disable network programmatically

亡梦爱人 提交于 2019-11-30 08:50:11
We have stumbled upon such a problem. We are developing an application for travelling. To make sure the user doesn't spend much money on roaming charges in our app we decided to implement a settings option for user to view cached maps only. So we let the user decide whether he wants to load the maps from internet or he wants to save money and view cached maps (stored in Library/Caches/MapTiles/MapTiles.sqlitedb). We can't find a way to implement this. Is there any way to disable network programmatically in this case? Or force MapKit use cached tiles only? We thought about changing APN

How to get to the max zoomlevel on iOS MKMapView

核能气质少年 提交于 2019-11-30 08:40:08
问题 One of my apps uses the MKMapView at a very high (max) zoomLevel (high detail map) With the introduction of iOS7, I can't come nearly as close to the map as before. I am using the mapView setRegion: method for this. I have been running tests and these are the results: spans across iOS versions in full screen portrait mode mapview: iOS 5.1: 140 meters iOS 6.1: 70 meters iOS 7.0.3: 281 meters iOS 7.0.3: 160 meters (if pinched manually!!) Is there a way to achieve the 160 meters (the max

Map Location names in drop down list

試著忘記壹切 提交于 2019-11-30 07:45:11
My App Has to integrate search location names using text box. Is Map kit has any method to implement this kind of a functionality ? This below image displays what i exactly need No , there is not any method of MapKit to implement this type of property.. For That You have to implement Your own Code, i.e. use of UISearchbarCantroller or Simple UISearchbar. For Search results you can use Google Place Autocomplete api. You can Use this GooglePlacesAutocomplete Example . In iOS >= 6.1 provides MKLocalSearch , MKLocalSearchRequest to search for natural language points of interest. Sample

how to show multiple lines in MKAnnotation with autolayout?

 ̄綄美尐妖づ 提交于 2019-11-30 07:39:05
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 . Igor Azarov extension for adding multiple lines: import MapKit // must import MapKit for MKAnnotationView to get recognized extension MKAnnotationView { func loadCustomLines

Should I use MKAnnotation, MKAnnotationView or MKPinAnnotation?

那年仲夏 提交于 2019-11-30 07:38:55
问题 I'm calling a webservice and plotting some objects on a MapView. What I'm failing to understand is should I use MKAnnotationPoint or MkAnnotationView? I'm not sure. When I use MKAnnotation, the pins show up on the map, if I click on them, they show me the title, and subtitle. If I use MKAnnotationView, the pins show up but when I click on them, nothing happens. I'm also trying to add the right button callout/chevron looking button but haven't been able to figure that out either. Here's an

(iPhone) how to implement draggable pins using OS 4.0 MapKit?

半腔热情 提交于 2019-11-30 07:06:11
Can anyone provide any sample code/instructions for implementing draggable pins in OS 4.0 using the MapKit framework? Sure thing buddy (yes I'm talking to myself), In your custom annotation add: @property (nonatomic, readwrite, assign) CLLocationCoordinate2D coordinate; This satisfies the requirement of implementing setCoordinate, as mentioned inhttp://developer.apple.com/iphone/library/documentation/MapKit/Reference/MKAnnotationView_Class/Reference/Reference.html#//apple_ref/occ/instp/MKAnnotationView/draggable In your MapView delegate add: - (void)mapView:(MKMapView *)mapView annotationView:

put CLLocationCoordinate2D into CLLocation for Swift

我是研究僧i 提交于 2019-11-30 06:47:11
I have a method I want to call however when I get back the center of the map, it is in CLLocationCoordinate2D type. How do I put the results of CLLocationCoordinate2D into CLLocation? Figured it out. When mapView changes region, get the Lat and Lon from CLLocationCoordinate2D and create a CLLocation variable with the lat and lon passed in. func mapView(mapView: MKMapView!, regionDidChangeAnimated animated: Bool){ var centre = mapView.centerCoordinate as CLLocationCoordinate2D var getLat: CLLocationDegrees = centre.latitude var getLon: CLLocationDegrees = centre.longitude var getMovedMapCenter:

Z-index of iOS MapKit user location annotation

不羁的心 提交于 2019-11-30 06:24:54
问题 I need to draw the current user annotation (the blue dot) on top of all other annotations. Right now it is getting drawn underneath my other annotations and getting hidden. I'd like to adjust the z-index of this annotation view (the blue dot) and bring it to the top, does anyone know how? Update: So I can now get a handle on the MKUserLocationView, but how do I bring it forward? - (void) mapView:(MKMapView *)aMapView didAddAnnotationViews:(NSArray *)views { for (MKAnnotationView *view in

A MapKit for Mac OS X?

落花浮王杯 提交于 2019-11-30 05:04:17
on the iPhone we have the Apple's amazing MapKit. There is something similar for Mac OS X? If possible something more advanced than a simple WebView, because I need that it manage automatically at least: annotations the user interaction the zoom in/out an overlay view (Even if the maps are not from Google is ok.) Thank you very much! Jason Medeiros Update 2 MapKit is available in OS X 10.9 Mavericks : Map Kit Framework Reference . Update - pulled from my comment below The situation has changed and there now exists a third party MapKit for Mac OS X. Find it at http://github.com/Oomph/MacMapKit