mkmapview

How to show Cluster for MKPolyline with geojson data View in iOS Swift

你说的曾经没有我的故事 提交于 2020-01-03 02:31:10
问题 I am loading Mapview with geojson data. It contains 7000 data in that geojson file. Even I loaded that data into Mapview . Its loaded fine, but, the problem is mapview getting freezing/stucking for few seconds while zoomin/zoomou So, its getting very bad user experience. Even, I loaded the data in background thread, still mapview getting freeze. After I read few forums, we can load clusters to avoid this kind freeze UI issue for mapview, but, I did not found for geojson data loading with

How to update information on MKPinAnnotationView?

徘徊边缘 提交于 2020-01-03 00:54:11
问题 I've had some past experience using MKMapView and MKPointAnnotation , which I used to put some pin on a map. This time I am trying to go one step further and use MKPinAnnotationView , to write a label along with some of the pins. Unfortunately, it doesn't all work as I expect. Here is what I want to do: I have a map (an MKMapView object) and when I touch it, I put a pin at the touch point, then some computation is performed and this gives me a second point on the map. I put a second pin on

How to draw UIBezierPath overlay on MKMapView?

为君一笑 提交于 2020-01-02 21:54:31
问题 I try to subclass from MKOverlayPathRenderer and implement -createPath - (void)createPath { MKPolyline *line = (id)self.overlay; MKMapPoint *points = line.points; NSUInteger pointCount = line.pointCount; CGMutablePathRef path = CGPathCreateMutable(); CGPathMoveToPoint(path, NULL, points[0].x, points[0].y); for (int i = 1; i < pointCount; i++) { CGPathAddLineToPoint(path, NULL, points[i].x, points[i].y); } [self setPath:path]; } I create overlay here: CLLocationCoordinate2D coordinates[events

MKMapView not refreshing annotations

情到浓时终转凉″ 提交于 2020-01-02 21:50:46
问题 I have a MKMapView (obviously), that shows housing locations around the user. I have a Radius tool that when a selection is made, the annotations should add/remove based on distance around the user. I have it add/removing fine but for some reason the annotations won't show up until I zoom in or out. This is the method that adds/removes the annotations based on distance. I have tried two different variations of the method. Adds the new annotations to an array, then adds to the map by [mapView

Find nearest annotations from user location ios?

前提是你 提交于 2020-01-02 17:52:31
问题 I have an array of annotations.I am calculating the distance between each annotation from user location.What I want to know is, how can I find lets say 3 nearest annotations from these distances? Here is how I am calculating distance from user location to annotations. CLLocation *userLocation = self.mapView.userLocation.location; for (Annotation *obj in annotations) { CLLocation *loc = [[CLLocation alloc] initWithLatitude:obj.coordinate.latitude longitude:obj.coordinate.longitude]; //

UILongPressGestureRecognizer on MKAnnotationView not working for single touch

懵懂的女人 提交于 2020-01-02 10:23:15
问题 I've been trying to use a UILongPressGestureRecognizer in a MKAnnotationView subclass. Interestingly the gesture recognizer only triggers when using two ore fingers/touches. What prevents the gesture recognizer to get triggered with only one touch? Implementation UILongPressGestureRecognizer *pressRecognizer = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(handleLongPress:)]; pressRecognizer.minimumPressDuration = 0.25; pressRecognizer.numberOfTapsRequired = 0;

Find closest longitude and latitude in array from user location

安稳与你 提交于 2020-01-02 09:59:57
问题 I have an array full of longitudes and latitudes. I have two double variables with my users location. I'd like to test the distance between my user's locations against my array to see which location is the closest. How do I do this? This will get the distance between 2 location but stuggeling to understand how I'd test it against an array of locations. CLLocation *startLocation = [[CLLocation alloc] initWithLatitude:userlatitude longitude:userlongitude]; CLLocation *endLocation = [[CLLocation

MapView with clusters: how to display multiple annotations on same view

北城余情 提交于 2020-01-02 09:55:32
问题 I have integrated FBAnnotationClustering on mkmapview which works perfectly, but when there is more than one annotation at exactly the same place I cannot display the annotationView with the correct informations. I'm trying to loop through the annotations and display them in the same view (each with a callout button to display more info). So far I managed to make one callout work to display the details at the bottom, but in the annotationView it displays it without the right title, and there

How to show single annotation pin for a region when i have multiple coordinates for that region?

南笙酒味 提交于 2020-01-02 09:23:50
问题 I am working on the map application and as per requirement i need to show a single pin for a single region even if it has multiple user coordinates when its completely zoomed out but when its zoomed in to the map then i should display all the pins as per its coordinates. I have given example below to explain my problem. I have city New York on this city I have 100 pins on my mapview when I am zooming out of my map it should show me only one annotation pin on the place of 100 pins but when I

iOS 6 maps- not animating PIN drop

血红的双手。 提交于 2020-01-02 09:11:10
问题 I have created a custom MKAnnotation class and it has been working - until iOS 6 came out. Since then my pins get added to the apple map but now without a drop animation! Is this how it is set or there maybe an an issue with the way I'm doing things. I have set a delay of 1 sec until the method that adds the annotations to the map is called, so I can see if the drop animations are actually occurring before the view appears - still, the pins just appear out of nowhere without dropping. Here's