mapkit

how to highlight countries in ios maps

删除回忆录丶 提交于 2019-12-02 16:21:13
I am building an app in which I have to highlight some countries dynamically in the world map. In short I want to customize the whole view of ios maps as shown in the images. can this be done using MapKit or is there any other method. Thanks in advance incanus You want to look into the Mapbox iOS SDK which will allow you to do this and more with a MapKit-like API. In particular, you will want to quickly make a custom map with TileMill using the provided Natural Earth data set for world country borders, enable UTFGrid interactivity so that the tapped regions can be identified, and use the

How to call a segue from a disclosure button on a map pin?

两盒软妹~` 提交于 2019-12-02 14:14:35
问题 I have an app that plots pins on a mapview. Each pin uses this code to display a detail disclosure button, which when tapped calls a showDetail method which then calls the prepareForSegue method. Im thinking there is a lot of extra work here. Should I eliminate the showDetail and just call the prepareForSegue method? but how would I pass in the MyLocation object? Here is the code: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { static

iOS + MKMapView user touch based drawing

笑着哭i 提交于 2019-12-02 14:10:42
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. Currently I have a UIView on top of my MKMapView where I do some custom drawing, is there a way to

MapKit giving wrong lat & lang - iOS 8

旧街凉风 提交于 2019-12-02 13:01:22
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 -(CLLocationCoordinate2D) getLocation{ CLLocationManager *locationManager = [[[CLLocationManager alloc] init] autorelease];

Adding a button to MKPointAnnotation?

╄→гoц情女王★ 提交于 2019-12-02 12:31:54
I just wrote few lines of code and got stuck trying add a detail button to my annotation point, I don't know how. Does anyone know how to do that? The image below shows what I want to achieve. Thanks! http://i.stack.imgur.com/kK1Ox.jpg Im trying to get the big i in the circle in my annotation. Right now I just have an annotation with a title and a subtitle, which looks like below. http://imgur.com/L3VMe5l.png Also, if you know, when a user clicks on the i in the circle, how do i bring them to a new segue? Thanks for your help. import UIKit import MapKit class PropertyMasterViewConroller:

Custom MKPinAnnotation callout bubble similar to default callout bubble

与世无争的帅哥 提交于 2019-12-02 12:19:44
问题 i want to create a custom callout bubble on MKMapView. But i want to create the call out bubble in the same manner of default bubble. So how to create a View look like annotaion in this image (source: objectgraph.com) I want a custom custom view which look like "Parked Location" annotaion in the following image. with custom width, height etc. P I am not able to add required details in Default bubble. Thats why am creating custom bubble. Plz help me..thanks.. 回答1: I have developed a custom

Adding different images to different annotation views in xcode

╄→гoц情女王★ 提交于 2019-12-02 12:18:04
问题 I am trying to add different images to different annotation views, in other words, i want a unique pic to correspond to each unique pin. Here is what I am trying: - (MKAnnotationView *)mapView:(MKMapView *)mapView viewForAnnotation:(id <MKAnnotation>)annotation { NSLog(@"welcome into the map view annotation"); // if it's the user location, just return nil. if ([annotation isKindOfClass:[MKUserLocation class]]) return nil; // try to dequeue an existing pin view first static NSString*

MyAnnotation view multiple lines text in iphone google map

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-02 11:49:17
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 map.How can i show the multilple lines? Thanks. The default style only supports the title and subtitle.

Why clusterAnnotationForMemberAnnotations in MKMapView is not called?

大兔子大兔子 提交于 2019-12-02 11:31:39
I have a simple map view: @IBOutlet private var mapView: MKMapView! Then one by one I add annotations: mapView.addAnnotation(Annotation(user: user)) and show them all: mapView.showAnnotations(mapView.annotations, animated: true) I also implemented the method: func mapView(_ mapView: MKMapView, clusterAnnotationForMemberAnnotations memberAnnotations: [MKAnnotation]) -> MKClusterAnnotation { print(memberAnnotations) return MKClusterAnnotation(memberAnnotations: memberAnnotations) } but this is not called at all. Why? It appears as though it is required to set the clusteringIdentifier for the

MKMapView centerCoordinate not exact

时光总嘲笑我的痴心妄想 提交于 2019-12-02 11:14:21
When I try to place a pin in the center of the map using MKMapView's centerCoordinate it puts a pin roughly in the center, but it's several pixels south of the true center of the map. I tried converting the map's center point to a coordinate MKMapView.convertPoint(MKMapView.center) and that worked perfectly on ios8 but on ios7 is still off (now its south and west of the true center). Anyone know how to determine how "off" the center coordinate is so I can adjust? I need this because I am placing a crosshair image over the map and need the pin to appear in the center of the crosshair. I've