mapkit

MyAnnotation view multiple lines text in iphone google map

浪尽此生 提交于 2019-12-02 21:29:58
问题 MKCoordinateRegion region1; region1.center.latitude = 50.366772; region1.center.longitude = 20.010607; region1.span.longitudeDelta = 0.01f; region1.span.latitudeDelta = 0.01f; MyAnnotation *ann1 = [[MyAnnotation alloc] init]; ann1.title = @"Text1"; ann1.subtitle = @"Text2\n, Text3\n, Text4\n"; ann1.coordinate = region1.center; [mapView addAnnotation:ann1]; I want to show the multiple line text for subtitle in google map.If i give the \n to break the line,it display directly the \n in google

MKMapRect and displaying map overlays that span 180th meridian

…衆ロ難τιáo~ 提交于 2019-12-02 21:16:35
I am working with viewports and bounds returned from Google Geocoding API . When doing reverse geocoding for a given coordinate, the service returns several results with various granularity (country, administrative area, locality, sublocality, route, etc.). I want to select the most appropriate on the results given the current visible area on the map. I've settled on algorithm that compares the ratios of areas (in MKMapPoint ²) of the location viewport, current map viewport and their intersection (using MKMapRectIntersection function). This works very well as long as the location viewport does

setAnnotation - unrecognized selector

爷,独闯天下 提交于 2019-12-02 20:59:25
问题 While running on a device after tapping the search button, I am getting this error but it is working in the simulator. 2013-03-08 17:58:33.981 IPAD[2661:907] Slider values are:min:5000.000000 and max:500000.000000 2013-03-08 17:58:33.989 IPAD[2661:907] +[SBJsonStreamWriter initialize] NSCache supported 2013-03-08 17:58:35.278 IPAD[2661:907] count is 806 2013-03-08 17:58:35.289 IPAD[2661:907] strcount is 806 2013-03-08 17:58:35.831 IPAD[2661:907] -[REVClusterPin setAnnotation:]: unrecognized

Exception when zooming with overlays on MKMapView: NSInvalidArgumentException NSSetM removeObject: object cannot be nil

六月ゝ 毕业季﹏ 提交于 2019-12-02 20:56:32
I am adding around 1000 MKPolygon s onto an MKMapView . After adding the overlays onto the MKMapView it works fine. However if I zoom in and zoom out quickly (occasionally letting go of the zoom so the mapView processes it's new visibleMapRect ) I find the app (sometimes) crashes with the following exception stack trace: *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '*** -[__NSSetM removeObject:]: object cannot be nil' *** First throw call stack: ( 0 CoreFoundation 0x0000000107db6b0b __exceptionPreprocess + 171 1 libobjc.A.dylib 0x000000010781b141 objc

Use MKLocalSearch to search for locations on a map

大兔子大兔子 提交于 2019-12-02 20:52:07
I want to use MKLocalSearch for searching in a Map. This functionality is available in iOS 6.1+. Does anybody know how to use this or can anybody give an example of how to use an MKLocalSearch ? MKLocalSearchResponse documentation The API for MKLocalSearch is fairly easy to understand. At its most basic, you alloc-init an MKLocalSearchRequest Set its naturalLanguageQuery to some search term Use the search request to initialize an MKLocalSearch object Tell the local search to start, passing it a completion handler Do something with the array of MKMapItem objects in the response Search for Cafes

Display MKMapViewAnnotations within a map view's visible rect

隐身守侯 提交于 2019-12-02 19:40:13
I'm displaying an MKMapView inside a Path-style parallax table view header. To create the effect, the mapView bounds is larger than the area visible to the user. I need to set the map view region such that all the map's annotations are contained within the visible rect of MKMapView. What's the best way to do this? Edit for clarity: Here's a use-case. The mapView size is 320 x 380. The visible area, however, is defined by the rect (0.0, 20.0, 320.0, 100.0). I need to set the region such that all the annotations appear in this rect within the mapView. Setting the map region so that all

Custom annotation move animation IOS Swift Like Ola Uber App MapKit Swift [duplicate]

六眼飞鱼酱① 提交于 2019-12-02 18:39:42
问题 This question already has answers here : move animation with custom annotation IOS Swift Like Ola Uber App MapKit (1 answer) Move the annotation on Map like Uber iOS application (1 answer) Closed last year . This is repost. I want to move custom annotation with animation like Ola uber car with rotation. Please only provide solution in SWIFT Here is que link move animation with custom annotation IOS Swift Like Ola Uber App MapKit I only know swift 来源: https://stackoverflow.com/questions

Showing nearby restaurants in MKMap View

女生的网名这么多〃 提交于 2019-12-02 18:35:58
In my iphone app,I have to show near by restaurants in Map View,Currently I am using Google map url in a web view. But how can I show nearby restaurants with in 5000 meters of current location with native MKMap view(I found out my current location-lat&long) I would like to learn how to implement as in the below screen shot(by clicking the annotations going to its detail too) Any helps ?? thanks in advance In iOS 6.1, you can use MKLocalSearch , part of the standard iOS MapKit.framework: MKLocalSearchRequest *request = [[MKLocalSearchRequest alloc] init]; request.naturalLanguageQuery = @

Why MKCoordinateSpan changes?

瘦欲@ 提交于 2019-12-02 18:09:46
问题 When I debug code below, I see that span is changed by mapkit from what I have provided. span2 contains different numbers from what was provided. Why is this happening? - (void) viewDidLoad { [super viewDidLoad]; CLLocationCoordinate2D loc; loc.latitude = self.atm.lat; loc.longitude = self.atm.lon; MKCoordinateSpan span1 = MKCoordinateSpanMake(0.05f, 0.05f); self.mapView.region = MKCoordinateRegionMake(loc, span1); // at this point numbers are not 0.05 anymore MKCoordinateSpan span2 = self

Apple MapKit 3D flyover

谁说我不能喝 提交于 2019-12-02 17:20:13
Is there any public iOS 8 API available to implement 3D flyover or at least 3D view as shown on Apple Maps App screenshot below? Update After below suggestions I've done following code: import UIKit import MapKit class ViewController: UIViewController { @IBOutlet weak var mapView: MKMapView! override func viewDidLoad() { super.viewDidLoad() // Do any additional setup after loading the view, typically from a nib. mapView.showsBuildings = true let eiffelTowerCoordinates = CLLocationCoordinate2DMake(48.85815,2.29452) mapView.region = MKCoordinateRegionMakeWithDistance(eiffelTowerCoordinates, 1000