MKLocalSearch not finding obvious results

前端 未结 3 1473
生来不讨喜
生来不讨喜 2021-01-06 10:14

My code is virtually identical to the following example:

https://github.com/iamamused/Example-MKLocalSearch.git

Here are the important bits:

         


        
相关标签:
3条回答
  • 2021-01-06 10:28

    Posting this for those who still have similar problem. You shouldn't use MKLocalSearchRequest() instead use MKLocalSearchCompleter which gives better results and is used in current Apple Maps.

    You can learn how to implement in this answer

    0 讨论(0)
  • 2021-01-06 10:45

    @borisz - too few points to comment directly..BEWARE of using Google Places API in your IOS app. Google states in their terms and conditions that any map displaying data fetched from Google Places API needs to be a Google Map. So if you still wish to use their API and search, just make sure that you are also using a Google Map and not Apple's native maps. Hope this helps - goodluck!

    0 讨论(0)
  • 2021-01-06 10:46

    I ended up giving up on Apple local search API and switching to Google. Their Place API is exactly what I needed. It finds relevant results quickly and up to 100k requests per day doesn't cost anything.

    Auto-complete: https://developers.google.com/places/documentation/autocomplete

    Details (need this for lat, lon): https://developers.google.com/places/documentation/details

    With the help of JSONModel I built it into my iOS app in a few hours.

    The results are exactly what I was hoping to see:

    enter image description here

    0 讨论(0)
提交回复
热议问题