mapkit

Determining distance using mapkit

自闭症网瘾萝莉.ら 提交于 2019-12-20 14:38:21
问题 How is a 1000ft or 1/2 mile distance determined with mapkit? Either a radius from some pin or the distance between two pins. For example, I center the map on pin A. Pins B, C, and D are also on the map at various distances from pin A. B and C are within 1/2 mile from A but D is 1 mile away. I'd like to know that B and C are within 1/2 mile from A. How can I calculate that? 回答1: Since you've stated that the two different points are "pins", I'm going to assume you're using MKPinAnnotationView

Determining distance using mapkit

空扰寡人 提交于 2019-12-20 14:38:07
问题 How is a 1000ft or 1/2 mile distance determined with mapkit? Either a radius from some pin or the distance between two pins. For example, I center the map on pin A. Pins B, C, and D are also on the map at various distances from pin A. B and C are within 1/2 mile from A but D is 1 mile away. I'd like to know that B and C are within 1/2 mile from A. How can I calculate that? 回答1: Since you've stated that the two different points are "pins", I'm going to assume you're using MKPinAnnotationView

Draw MKPolyline Fill Color

半世苍凉 提交于 2019-12-20 10:47:36
问题 I am attempting to draw a nice MKPolyline on an MKPolylineView . Everything is going great so far - the polyline draws just as I want it to and when I want it to using the following code: [[self map] addOverlay:routeLine]; And this method to tell the app how to draw it: - (MKOverlayView *)mapView:(MKMapView *)mapView viewForOverlay:(id <MKOverlay>)overlay { MKOverlayView* overlayView = nil; self.routeLineView = [[MKPolylineView alloc] initWithPolyline:[self routeLine]]; [[self routeLineView]

How to use MKMapView finished loading delegate, possible “finished displaying” delegate?

柔情痞子 提交于 2019-12-20 10:37:21
问题 I'm attempting to save a thumbnail of a mapview when a user taps save when an annotation has been selected. The problem occurs when the user has not zoomed in on that annotation yet, so the close zoom level has not been loaded. This is what I'm doing after the user taps save: Set a bool "saving" to true Center and zoom in on the annotation (no animation) When the mapViewDidFinishLoadingMap delegate method gets called, and if saving is true: Create an UIImage out of the view, and save it.

MKMapRect and displaying map overlays that span 180th meridian

我是研究僧i 提交于 2019-12-20 10:25:54
问题 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

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

為{幸葍}努か 提交于 2019-12-20 09:59:06
问题 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

Google Places API Violation

廉价感情. 提交于 2019-12-20 08:57:12
问题 I am using Google Places API to pull a list of resturants, and I am displaying them on map. However, since Apple has switched there map services over from Google in iOS 6.0, I am now in violation of Google's terms of use, which states that you must display Google data on a Google map. "If your application displays Places API data on a map, that map must be provided by Google." https://developers.google.com/places/policies#terms_of_use I obviously need to change the map, because I am not going

iOS + MKMapView user touch based drawing

与世无争的帅哥 提交于 2019-12-20 08:04:10
问题 I have searched a lot for this question, but none of them seem to do exactly what I want. A lot of tutorials show me how to add lines and polygons in code, but not with freehand drawing. The question is the following one: I am building a real estate application. If the user is on the MKMapView it has the ability to draw a rectangle/circle/... around a certain area where he/she wants to buy/rent a house. Then I need to display the results that correspond within the area the user has selected.

iOS + MKMapView user touch based drawing

亡梦爱人 提交于 2019-12-20 08:03:36
问题 I have searched a lot for this question, but none of them seem to do exactly what I want. A lot of tutorials show me how to add lines and polygons in code, but not with freehand drawing. The question is the following one: I am building a real estate application. If the user is on the MKMapView it has the ability to draw a rectangle/circle/... around a certain area where he/she wants to buy/rent a house. Then I need to display the results that correspond within the area the user has selected.

MapKit giving wrong lat & lang - iOS 8

柔情痞子 提交于 2019-12-20 05:57:36
问题 When I try to use map in iOS 8, I get below error. Trying to start MapKit location updates without prompting for location authorization. Must call -[CLLocationManager requestWhenInUseAuthorization] or -[CLLocationManager requestAlwaysAuthorization] first. For this I tried solution from here, but still no luck. Below is what I did. Step 1. Have entry in Info.plist NSLocationWhenInUseUsageDescription - This is test text Step 2. Updated -(CLLocationCoordinate2D) getLocation -