Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iphone create placemark from latitude and longitude

I want to place "pins" on my map. I've got the one for the user's location.

Now I'm downloading a feed of locations from the internet. For each one I receive a latitude and longitude.

I want to place these all on the map. I know I have to use a reverse geocoder, but I'm not entirely sure how to do this. Plus I read somewhere you can only do one at once, so I don't know how I would get all of my results onto the map.

Thanks for you help. :)

Tom

like image 279
Thomas Clayson Avatar asked Dec 28 '22 07:12

Thomas Clayson


1 Answers

To add a pin to map you need to do this:

CLLocationCoordinate2D coordinate;
MKPlacemark *mPlacemark = [[[MKPlacemark alloc] initWithCoordinate:coordinate addressDictionary:nil] autorelease];
    [mapView addAnnotation:mPlacemark];

And you can add any number of pins =)

like image 98
eviltrue Avatar answered Jan 08 '23 18:01

eviltrue