0

In my iphone app,I have to show near by restaurants in Map View.

But how can I show nearby restaurants with in 5000 meters of current location with native MKMap view(I found out my current location-lat&long)

I would like to learn how to implement as in the below screen shot(by clicking the annotations going to its detail too)

enter image description here

m.s.
  • 16,063
  • 7
  • 53
  • 88
Barani
  • 84
  • 1
  • 1
  • 12

1 Answers1

0

You can use foursquare API as one possibility. https://developer.foursquare.com/

  1. fetch venues from API

    var venues: Array = fetchVenues()
    
  2. Make annotation

        var venueAnnotation = MKPointAnnotation()
        venueAnnotation.coordinate = CLLocationCoordinate2DMake(venue.latitude!, venue.longitude!)
        venueAnnotation.title = venue.name
        venueAnnotation.subtitle = venue.address
    
  3. Add annotation to MapView

        self?.mapView.addAnnotation(venueAnnotation)
    

This site might be helpful to you.

iOS Development: Near me Places- (FourSquare API) http://prashantpatil26.blogspot.jp/2014/06/near-me-places-foursquare-api.html

Kosuke Ogawa
  • 7,383
  • 3
  • 31
  • 52
  • 1
    note that these days you **very simply use MKLocalSearchRequest to do this on iOS**, it is as easy as can be – Fattie Aug 31 '17 at 03:48