How to find coordinates in Apple maps?

Asked

Viewed 433 times

0

I need to show several different places on the map, one for each location, I would like to know how to point to each coordinate through the code?

In case the app is for iOS, using Objective-C.

1 answer

2


Using the MapKit few lines of code are required. After adding the framework to the project and the map itself on the screen, you can insert a point in a given coordinate in this way:

// Alloca um novo MKPointAnnotation que pode ser usado como pin no mapa
MKPointAnnotation *point = [[MKPointAnnotation alloc] init];

// Ajusta para a coornedada desejada
point.coordinate = CLLocationCoordinate2DMake(-21.805149, -49.089977);

// Pode customizar o título e subtitulo
point.title = @"Título";
point.subtitle = @"Subtitulo do pin";

// Adiciona o pin no mapa
[self.mapView addAnnotation:point];
  • Face your answer is phenomenal!!! It advanced me 90% of the work. But it’s more than 20 locations and the client is from another state and he doesn’t know how to do it. I thought to see the coordinates in Goole Maps and convert to Apple map, I’ll give you another search! But your answer is really helpful! Thanks again!!!

  • I did a test here tbm, it seems that the coordinates of Google Maps tbm serves for the Mapkit, but is not 100% accurate :/

Browser other questions tagged

You are not signed in. Login or sign up in order to post.