mapkit

iOS7 Map Kit remove default location icons

我与影子孤独终老i 提交于 2019-12-03 16:34:46
问题 I am wondering if it's possible to remove all the default icons from the map kit . I did a lot of researches and tried a couple of different ways. Couldn't find any way to do this. Don't know if anybody can help us out. 回答1: It won't get rid of all those icons (I think the road markings will stay) but you can use the iOS 7 MKMapView property showsPointsOfInterest , setting it to NO to remove shops and other icons. [myMapView setShowsPointsOfInterest:NO] From the docs: When this property is

Find nearest location from existing coordinates mapkit

不问归期 提交于 2019-12-03 16:28:32
I am in the process of developing an iphone app (objective C) for a client who has multiple stores. I have the coordinates (latitude,long) of all the stores (20) in an array. At the moment I am thinking of looping through the array of stores' coordinates and get the distance from the user's current location to the store's location and then add them into array and does sorting on the lowest distance. Is this a correct approach or very resource hungry? The nearest question of SOF was this one but it is in python: extracting nearest stores Thank you in advance for your advice. To find nearest

How to draw GeoJSON in Apple Maps as overlay using Swift 3

Deadly 提交于 2019-12-03 16:27:39
I am trying to draw the following GeoJSON data as an overaly in MKMapView. The GeoJSON File is as below. { "type": "FeatureCollection", "features": [ { "type": "Feature", "properties": { "Name": "line1" }, "geometry": { "type": "LineString", "coordinates": [ [ 76.35498046875, 25.145284610685064 ], [ 81.36474609375, 25.06569718553588 ], [ 83.91357421875, 23.301901124188877 ], [ 82.001953125, 22.004174972902003 ], [ 78.33251953125, 21.248422235627014 ], [ 76.31103515625, 21.268899719967695 ] ] } }, { "type": "Feature", "properties": { "Name": "point8" }, "geometry": { "type": "Point",

Disable compass on MKMapView

三世轮回 提交于 2019-12-03 15:59:34
问题 I am using a MapView in my app to show some annotations. In iOS 7 a compass appears randomly on the map. I can't reproduce the error because it appears randomly but I want to disable it. Any ideas how to disable it? Update: I found out is not appears randomly but on a specific gesture. When you use 2 fingers and slide one right and the other left. 回答1: You can disable the compass easily on OSX 10.9 / iOS 9 and later with the showsCompass property: yourMapView.showsCompass = NO; On iOS 8 or

MKLocalSearch doesn't provide the same results as search in native Apple Maps app

隐身守侯 提交于 2019-12-03 15:34:41
When I search in MKLocalSearch and Apple Maps using the same string I get different results, usually in Apple Maps I get a lot of different locations but in MKLocalSearch I get only one. Apple Maps: My app using MKLocalSearch: In both cases I was searching being in Berlin and in MKLocalSearchRequest I set .region property of Berlin region Which services does Apple use for their location search? After doing some searching I've investigated that MKLocalSearchCompleter is the class that Apple uses in their Map app. 来源: https://stackoverflow.com/questions/43249382/mklocalsearch-doesnt-provide-the

Monotouch MapKit - annotations - adding a button to bubble

拟墨画扇 提交于 2019-12-03 13:28:59
Anyone know if there's anyway to get a button onto an annotation? I'd like the location to be selectable - so you can say.. select the location and get all the events at that location by clicking on the button. is this possible? w:// Here's the code I used for my annotation, it includes a button on the right side of the bubble. You can set an IBAction to push a new view onto the stack to display whatever you want - (MKAnnotationView *)mapView:(MKMapView *)mV viewForAnnotation:(id <MKAnnotation>)annotation { MKPinAnnotationView *pinAnnotation = nil; if(annotation != mapView.userLocation) {

Putting UIButton and other UIControl objects inside an MKAnnotationView and allowing user interaction

女生的网名这么多〃 提交于 2019-12-03 13:17:49
I have a custom annotation view on the map, which has a UIButton in it, but the UIButton is not responsive when pressed. I have two main problems with user interaction on the annotation view: Buttons and other controls are not responsive. I want the annotation to block touches according to my implementation of - (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent*)event - that is if I return YES then I don't want the touches to get sent through to the MKMapView (potentially selecting other annotations that are BEHIND my annotation view), I want to handle the touch myself in this case. I have

MKPolyline strange rendering related with zooming in MapKit

99封情书 提交于 2019-12-03 13:17:22
问题 I have very simple View Controller to demonstrate this strange rendering behavior of MKPolyline. Nothing special just normal api calls. import UIKit import MapKit class ViewController: UIViewController, MKMapViewDelegate { @IBOutlet weak var map: MKMapView! override func viewDidLoad() { super.viewDidLoad() map.delegate = self } override func viewDidAppear(_ animated: Bool) { super.viewDidAppear(animated) let p1 = CLLocationCoordinate2D(latitude: 51, longitude: 13) var coords = [ p1,

show users location blue point in iPhone MKMapView

允我心安 提交于 2019-12-03 12:47:43
问题 I am developing a custom pins in a MapView in my iPhone app. Here is the code: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static NSString *AnnotationViewID = @"annotationViewID"; MKAnnotationView *annotationView = (MKAnnotationView *)[myMapView dequeueReusableAnnotationViewWithIdentifier:AnnotationViewID]; if (annotationView == nil) { annotationView = [[[MKAnnotationView alloc] initWithAnnotation:annotation reuseIdentifier

Issue with overlapping annotations (MKAnnotationView) on map

本秂侑毒 提交于 2019-12-03 12:18:59
In my iphone application, I'm using MapKit with MKMapView and custom MKAnnotationView. The problem is when annotations overlap on map (in my app, annotations are photos and those photos may overlap) and when you tap on the annotation that appears on front, it's another annotation (on back) which receives the event (seems to be random). I didn't find any way to send the event to the front annotation. I cannot believe this bug/problem doesn't have any solution! Z ordering and Order of overlapping annotations questions on stackoverflow did not help me that much. Please any idea is welcome (even