I would like a map inside my iphone app which I want to query with search terms depending on certain values.
Does the mapkit framework accept queries of e.g. The United States and then display them?
I know this is really simple compared to the uses available from mapkit, that is why I wonder if it is covered?
This answer might be useful:
How do I do geocoding (NOT reverse geocoding) on iPhone?
Currently MapKit only provides Reverse Geocoding from coordinates to an address. For forward geocoding (an address or placename to coordinates) you'll need to use a geocoding API.
If your application only has a set number of things to be searched and you know the coordinates (like countries in your example) you could store and search them in core data, sqllite etc.
Related
I'm making an iPhone location based app and I'm having trouble with the last aspect of it. I was wondering if anyone knows how to integrate a search bar that correlates with the map that we can use from MKMapView.
It's literally a search bar above the map that the user can type in an area and it will take them there.
Is this possible?
I've looked around for tutorials but I have only found how to make an app with a map view, annotations and adding callouts.
What you're looking for is geocoding - the process of turning an address in your search bar into a latitude/longitude coordinate, which you can then set the map's position to.
This question has two main answers. This answer shows how to geocode using a Google API, and this answer shows how to geocode using an Apple API.
If you're using MapKit (which uses Apple maps as of iOS 6.0), then you should probably use the Apple API (you are not supposed to use Google Maps APIs with non-Google maps).
If you're using the new Google Maps SDK for iOS, you might want to use the Google API for geocoding. Although note that the answer I've linked to is using the Google API with MapKit (as it was written back when MapKit was using Google Maps), so you would need to modify it a bit.
I'm developing a little iOS App which shows POIs on a standard MKMapKit map (from Apple). When the user select a POI, the app send a request to Panoramio to get a photo from the latitude and the longitude, like that :
http://www.panoramio.com/map/get_panoramas.php?order=popularity&set=public&from=0&to=2&minx=XXXXXXXX&miny=XXXXXXXX... etc...
The problem is that I saw today on the Panoramio ToS :
http://www.panoramio.com/api/terms.html
Section 2: API Client restrictions
You may not use the API in API Clients using map technology other than Google Maps or any photo-sharing sites.
I'm not using Google Maps API for iOS so the question is : can I use the standard MKMapKit from Apple AND show photos from Panoramio in the same app ?
If not, is there an alternative solution to get photos from GPS coordinates ?
Thanks
First off, I AM NOT A LAWYER AND THIS IS NOT LEGAL ADVICE.
Disclaimer aside, use apple's CoreLocation classes to generate latitude/longitude information, and you never touch mapping software.
Geolocation and mapping are two complimentary functions that don't necessarily interact.
From what I read there, I don't see a problem with retrieving your location via the CoreLocation framework, and subsequently using that info to request map information from Panoramio.
Good luck!
I am building an iOS application that in one of its functions implements reverse geocoding for obtaining street addresses from user gesture tap on a map.
When running the app using CLGeocoder's reverse geocoding features, I was only able to get the city and country details. In some cases in main roads I was able to get the main road name.
I thought that this limitation is from the Google Maps api.
But when I tested this example, (http://gmaps-samples.googlecode.com/svn/trunk/geocoder/reverse.html) I was able to get much more accurate and detailed information such as street number and name and zip code.
Is this a limitation of CLGeocoder? if so, how can I implement the Google Maps api on my app?
It's my understanding that CLGeocoder has not used Google for data for around the last year; When it did use Google there was a substantial limitation on number of users per day.
You may also want to try the same CLGeocoder call in an iOS6 simulator to see if you get more data.
You could use the Google API calling directly from your app, but be carful to read the TOS for limitations in regards to users.
Well, it would appear that yes, Apple's CLGeocoder is nothing like as accurate for forward geocoding (address -> coordinates) as the Google Maps Geocoding API, particularly outside of the USA. Using an Address Dictionary with all the fields filled out as fully as possible works a lot better than a simple address string, but it's still no where near good enough. Where Google will (usually) give you coordinates within 5-10m of the street number, Apple will give you coordinates somewhere in the right street, if you're lucky.
Found Apple Developer Technical Note TN2289 which details Supported Countries for CLGeocoder.
Further iOS6 would stop the support to use of Google Maps
I would like to know if it is possible to pass an address from an SQlite data base to GPS or Google maps and have it show on a map at the press of a button. If anyone is aware of a tuturial that could help me that would be appriciated.
I would also like to get current location and show local places on map, also populated from the same database. Thanks in advance.
In order to translate address to lat/long coordinate you will have to use the Google directions API since apple is not supporting forward geocoding.
You can take a look at this API - pretty straight forward:
http://code.google.com/apis/maps/documentation/directions/
for iOS 4.x and below you will need to use the Google API but in iOS 5 Apple has implemented a really nice foreword geocoding API.
I'm interested in finding out the coordinates of "any" given address and not just the current location using only CoreLocation.Framework. I do not wish to use google maps API or yahoo maps or any other third Party maps API.
Is it possible? How can I get the coordinates of any address?
Thanks
EDIT - Thanks to a comment, I realized my original answer is dreadfully out of date. At the time, in late 2009, it was a massive pain to geocode - reverse geocoding was possible via Core Location APIs, but forward geocoding was not possible until iOS 5.
But in iOS 6.1 MapKit introduced an even better API, the MKLocalSearch class. It's very easy to perform search queries for an address and then inspect the properties of the returned objects.