Building a City/Country Search box. Can Bing API support this? - bing-maps

I'm currently building a search box for a mobile app that can search for a Country/ State/ Country. I'm currently looking for APIs that can support this... An option for me would be the Google Places API but as much as possible I don't want to use Google for my project.
So before I import the Bing SDK into my project, I'm curious if anyone knows if this is possible with Bing API.

With Bing Maps you can use the location query API: https://learn.microsoft.com/en-us/bingmaps/rest-services/locations/find-a-location-by-query however, it will also find addresses if you pass them in. Generally though, if you type just a state or country, this API will return the expected result. You can add a bit of code to look through the results and filter them based on their entity type if required.
Since you tagged Azure Maps, you can use the Azure Maps address search API: https://learn.microsoft.com/en-us/rest/api/maps/search/get-search-address It has filtering parameters available that might be better suited for this scenario.

Related

Using Google Map APIs

I am currently working on a personal project to develop a REST API which would perform tasks similar to what UBER, OLA like taxi aggregators do. Below is the brief about the functionality that I plan to add:
1)I have a fleet of cabs whose location is determined by its latitude and longitude.
2)A customer can call one of the cabs by providing their location and my API should assign the nearest cab available.
This I suppose would be accomplished by using Google Map APIs. My question is how do i start on using these APIs, to simulate such functionality?
You may use the following references:
Choose from the Google Maps APIs documentations depending on your needs. There are actually tutorials given within the documentations.
Answers to Frequently Asked Questions will also help especially the getting started part to fully understand how Google Maps APIs work.
Last but definitely not the least, this example in GitHub might help you exactly on the implementation.

Google Geocoding API: number of results

Is there a way to increase the number of results returned by Google Geocoding API. Right now the default seems to be 10, however it does not seem to include the intended result.
Thanks
Getting more results from the Geocoding API is not necessarily a solution. And no, can't get more.
Instead, you may want to use the Places Autocomplete API, or the Places library in the Maps JavaScript API. Specially when bound to a map, it makes it much easier for users to find places.

Search Google POI (maps.google.com)

when you go to maps.google.com and search for "cupcakes" for example, you get the results displayed on a map, and on the left there is a list of results.
I want the user of my application (iPhone and Web) to be able to enter a search term, then it searches on google and provides a list (much like the list on the left in maps.google.com), the user can then select a location from the list.
The list would need to be in XML format or something similar that can be parsed on the iPhone. It needs to include the Name of the location, a description (if provided) and its address/coordinates.
Is this possible, and if so, how can it be done?
You'll probably want to use the Google AJAX Search APIs, which has a different set of terms from the Geocoder. The Geocoder is for taking an address and returning a lat/long, not for things like local search. Specifically, you'll want to use local search feature. Check out the section on "Flash and other Non-Javascript Environments" for info on how to access this though a RESTful interface (for the iPhone).
Google provides a number of map services where you can search for locations, etc. Especially their Geocoding API may be of interest. If you use their services you are however required to show these results on Google Maps.
An alternative to Google is to use one of the free GeoNames services. They have a more relaxed set of conditions.

How does Urbanspoon display map?

I've looked at Google's map API, which is all javascript and terribly slow on the iPhone. I then tried using the link option available at maps.google.com. That is fast but I can't see having much control over it. It also displays a little search box at the top of the map. Google's API says you must use maps in a website, which the iPhone isn't. I'm not sure about licensing for maps.google.com.
Urbanspoon's scope option does everything I want with maps in regards to displaying nearby businesses based on your location. Given the limited set of tools available for Google maps without mapkit, I don't know how they are doing it. It looks as though they have somehow integrated with mapkit. Clicking an annotation shows the callout and another click pushes a new view with details from that pin. Any ideas how this can be done?
-- EDIT --
Just to be clear, mapkit doesn't display surrounding businesses. That's the crux of the problem and I'm not sure how Urbanspoon got past it.
You can also use the Google AJAX Search API: http://code.google.com/apis/ajaxsearch/
It's a Javascript library, but for Flash, and other Non-Javascript environments, the API exposes a raw RESTful interface that returns JSON encoded results.
And within this API, what you want is the 'Local Search' if you are looking for nearby businesses based on the location.
Urbanspoon probably gets the data for the locations of nearby businesses via some other method than the MapKit API.
Then its likely that they use the MapKit API to display custom MapKit Annotations at those locations.
If you are looking for a business data provider you could look into yelp's API.

iPhone - can I use MapKit without displaying a Map?

I am writing an app that will use Reverse Geocoding to translate the user's current location into something like a Street Address or City. It seems the only way to get this kind of information is via MapKit (specifically the Placemark class).
Can I use this without having to display a map to the user?
The reason I am asking this is because in the Google HTTP Reverse Geocoding documentation it states:
Note: the geocoding service may only be used in conjunction with displaying results on a Google map; geocoding results without displaying them on a map is prohibited. For complete details on allowed usage, consult the Maps API Terms of Service License Restrictions.
I'm wondering if this holds true for the MapKit API as well or if Google and Apple worked something out.
I answer my own question way too much around here -
10.12 use or display the Content without a corresponding Google map, unless you are explicitly permitted to do so in the Maps API Documentation, the Street View API Documentation, or through written permission from Google (for example, you must not use geocodes obtained through the Service except in conjunction with a Google map, but the Street View API Documentation explicitly permits you to display Street View imagery without a corresponding Google map); or
via Google Maps iPhone TOS
The Map Kit framework provides an embeddable map interface for your application. Use it to display map or satellite imagery from the windows and views of your custom applications. You can also use the framework to annotate your maps with points of interest and other custom information.
What was stated above about using Googles HTTP API for reverse geocoding would be a better way to display the information you are looking for and using a text box to read the information.