Reverse geocode using MKReverseGeocoder - google-maps

Google Terms says I can only use reverse geocoding in conjunction with a google map.
Is it ok if you first see the address in a uitableviewcell and then on a click see the location in a map (is this "in conjunction") ?
Tried two other free services but they don't find all locations as it seems.
Edit
I see in an answer that I need to clarify
The app should get the current gps location first using CLLocationManager and this location (latt,long) should be translated into a street/city name and displayed on the cell.
Then, after getting a green/yellow light and a location description that fits the accuracy needs of the user, the user should normally click on the cell causing a map to load with stores of a certain company that are nearby. ("normally" because he could also hit another cell "Enter different location").

Caveat emptor I am not a lawyer and this advice is not a substitute for actual legal advice.
Assuming that when you click on the address, only then the address is reverse-geocoded, and the marker is displayed on the map, then yes, that would certainly count as "in conjunction" in my book.

Related

Google places autocomplete get the place type

I have a simple application where the user fills in the start and end point (with google places autocomplete) and then, with directions services, I draw the route on Google Maps.
I can calculate the gas needed for that route, the tolls that the driver must pay etc.
Its working fine so far.
Now I have to check if the start point or end point is an airport (I assume that I have to check the place type) and I have no idea how to achieve that.
I know that the places autocomplete object contains the place type and I was wondering if when selecting from the autocomplete I can pass to a hidden field the place type and then check if is the appropriate type.
(or any other more appropriate solution)
The predictions in place autocomplete might be a bit confusing. Let's have a look at the following example. I would like to find 'aeroport El Prat Barcelona'
https://maps.googleapis.com/maps/api/place/autocomplete/json?input=aeroport%20El%20Prat%20Barcelona&key=YOUR_API_KEY
The first prediction has a text Aeroport, El Prat de Llobregat, Barcelona, Spain with place Id ChIJO46GD4eepBIRIn5B25NbcNQ. At first glance it seems to be airport, but when you check the types in the response you can see
"types":[
"transit_station","point_of_interest","establishment","geocode"
]
So this is not an airport, but the train station close to the airport as shown in the following screenshot.
At this point it looks like you cannot rely 100% on the type provided by autocomplete, because you can get something very close to the airport like the train or bus station that share the 'airport' in the name.
As a workaround I would suggest checking with places API nearby search if there is any airport close to coordinate returned by autocomplete. But this requires two additional steps:
Resolve place ID to coordinate. E.g. https://maps.googleapis.com/maps/api/geocode/json?place_id=ChIJO46GD4eepBIRIn5B25NbcNQ&key=YOUR_API_KEY will return 41.3042622,2.0733891
Use nearby search to figure out if there is an airport in radius, for example 500 meters https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=41.3042622%2C2.0733891&radius=500&type=airport&key=YOUR_API_KEY
The last request returns the airport as shown in the following screenshot

How can I create links Google Maps that either use the place name in the query (for known places) or just the address otherwise?

I am creating links to Google Maps for a large number of locations using this URL pattern:
https://www.google.com/maps?q=[query]
In many cases, Google knows that the particular business exists at that location. In those cases, I want to include the place/business name in the query so the resulting map shows additional information about the business (e.g. name, phone numbers, site URL, office hours, etc.). For example:
https://maps.google.com/?q=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701
But, if the place isn't known, including the business name in the query prevents the map from adding a marker to the correct address. For example:
https://maps.google.com/?q=Awesome+Paint+527+Cabrillo+Park+Dr+Santa+Ana,+CA+92701
It can cause the map to be totally zoomed out, or focus on a competing business with a somewhat similar name in the same general area.
How can I make this work better? I would like the map pin to always go in the correct location for the address I specify. If the business name I provide is known to Google at that address, then I'd like the nice panel of extra information. If it is not known, I just want the pin.
Thank you.
This similar question is asking about creating embedded maps, which is a slightly different case Google map to show name of location if found, otherwise just the address. I'd prefer to avoid extensive use of the APIs because I'm worried about exceeding the free limit, but more generally geocoding the address that worked above (Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701) returns zero results like so:
http://maps.googleapis.com/maps/api/geocode/json?address=Child+Guidance+Center,+Inc.+525+Cabrillo+Park+Dr+#300+Santa+Ana,+CA+92701

Get street suggestion (start point) in GMaps Directions service

I'm using Google Maps API 3 for returning directions from user's input address (destination node) to a Store (predefined start node).
I ask for user's address (not geolocation but through a simple input field) but I wouldn't like the user to narrow their input by entering extra info like postcode, state, city. I just want to make the input of the user as little as possible, e.g. 123 Road street.
However, when I type an address with a common name (like 25 Main street), the route I get is possibly the first result that Google has available, even if it is 3000 miles away when the user's address could be 2 miles away.
I have read all Google's documentation in regards to Directions service but I couldn't find anything that relates to street suggestions. Do you know how I can serve suggestions to the user so that the start address would be the exact match of user's preference?
I'm afraid this is impossible to achieve without any detail for the real location of the user.
Of course you would be able to filter results(regardless of the used service) by the distance, but how could you know if the user is located at the nearest address...you can't.
A possible solution may be to use a places-autocomplete (i guess that's what you mean by "serve suggestions"), the user would be able to choose his location from the predictions.
Another approach:
Instead of a input-field you may let the user click on the map to mark his location

Set location on google map

I have created one small application, where user can store his/her contacts with full address including map. Therefore I am using the Google Maps API, where user can point out his/her address.
For this I have given address fields with Country, State and City. When user entered this information, I am showing the default address on Google Maps, then the user has to drag the marker/pointer onto his/her exact location.
Now, in this case I want the zoom level of googles map to be set as per location's population.
This means if the user entered city with no mans land (less population or any desert place or any jungle place or very small area on city then zoom level should be more, so user can see proper area on map) otherwise zoom level should be less.
Can some one guide me how to do this?
This won't be possible using the Google API's alone, (I'm unsure if demographics info has been released for the US, I know it was in the works, but it certainly won't work elsewhere). You will have to find an external source to provide your demographics information for you.
The Google API's do not keep a public record of population density.
You could however be a but more tricksy and use an approximation. You could for example do a places search in the area (using an arbitrary radius), count the number of results and use this to set your zoom level (again using an arbitrary value to determine high/medium/low etc). It's a fair assumption (though still an assumption) that any area with a large number of 'places' returned will be densely populated.
You don't need to base this on the population of the location. Please check the follwing link. I think it should give you an idea of the options you have.
Google Maps API v3 - Geocoder results issue with bounds
Check both my question and my answer. You will probably want to use the viewport object.

UK Google Maps with check box options

I just want UK google map with checkbox option. And check box have option like
Primary Schools
Secondary Schools
Colleges
Universities
Transport
when any user click on these option then it activated, So my basic question is that, Is google provide any API for this purpose or i have to point out every single location because pointing out every single loaction is very time consuming. The example of this kind of map is here, go to map & nearby. Thanks
Google does provide an API for this
https://developers.google.com/places/documentation/search
The API does allow you to add parameters, for example
https://maps.googleapis.com/maps/api/place/search/xml?location=37.77264,-122.409915&radius=500&types=food&sensor=false&key=yourApiKey
Which will return a list of markers you can use to populate your map