iosobjective-cmkmapviewmkcoordinateregionmklocalsearch

Filtering Restaurants in MKMapView


I was wondering if MKMapView supports filtering restaurants based on cuisine? If you search "Chinese Restaurants", for example, will Chinese restaurants appear or is there a separate code for that, if even possible? Thanks.


Solution

  • MKMapView has no filtering functionality like you have described. MKMapView is used to simply display or annotate a map. From the Apple documentation, "An MKMapView object provides an embeddable map interface, similar to the one provided by the Maps application. You use this class as-is to display map information and to manipulate the map contents from your application."

    To do something like you described, you would need to already have a dataset of Chinese Restaurants in a specific area. Then you would use the MKAnnotation protocol to annotate Chinese Restaurants on the MKMapView

    https://developer.apple.com/library/ios/documentation/MapKit/Reference/MKMapView_Class/