I am trying to use mapkit in my app and I have found lots of tutorials on how to find a location with longitude and latitude but none on how to find it with a street address. Is there a way to type in a street address and have the map go to that location.
I am trying to use mapkit in my app and I have found lots of tutorials on how to find a location with longitude and latitude but none on how to find it with a street address. Is there a way to type in a street address and have the map go to that location.
Thanks
Clinton
There is not a way to do that directly with the MapKit. The Google Maps server API supports looking up a location by address. They impose their terms of service on using it.
They used to provide a simple, URL-based way of looking up an address. That method has been deprecated, however, and now you're supposed to use a JavaScript query. Our app, Save My Place, uses the older, simpler API, but I would suggest not using that, since it might not be supported for much longer.
Do a search on "Google Maps JavaScript API V3" to find their documentation on the subject. It will be listed under "Geocoding".
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
...and beware of the Google terms of service. Read them carefully and make sure you comply. You're only supposed to use Google's servers if you present the results in a Google-branded map image, plus other restrictions. I don't remember the specifics,.
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
Use of the Google Geocoding API is subject to a query limit of 2,500 geolocation requests per day. (User of Google Maps API Premier may perform up to 100,000 requests per day.) This limit is enforced to prevent abuse and/or repurposing of the Geocoding API, and this limit may be changed in the future without notice. Additionally, we enforce a request rate limit to prevent abuse of the service. If you exceed the 24-hour limit or otherwise abuse the service, the Geocoding API may stop working for you temporarily. If you continue to exceed this limit, your access to the Geocoding API may be blocked.
I tried typing in a street address just using my broswer and I got a json back with all the info. But when I tried adding in city, province it cam back with zero results.