I have an app that bumps the user out to Apple's maps to get directions to a business location, and I'm passing lat/long. Pretty simple, the URL I'm using is the following:
http://maps.apple.com/maps?daddr=lat,long
This of course works fine, but the client doesn't like the lat/long showing when the user gets to the maps, since it doesn't look very 'user friendly'. They would prefer the business name (which we have available) to actually show there. I informed them that this wouldn't work if we just passed in the business name alone, since Apple's maps may not know about that particular business' location.
However, they wanted to know if it was possible to somehow have it still show the business name in the destination-address, alongside the lat/long. Something like the following: "(Business Name) lat,long", where the business name is ultimately ignored and lat/long used. I've played around with this a bit with no luck.
Looking at Apple's documentation, I don't see of an obvious way of accomplishing this. Is this even possible? No worries if not, but just wanted to get some feedback. Thanks!
If you're writing an app, you could use MKMapItem instead of using the link URL method. With one of these, you can add a bunch of extra information, such as the business name and phone number, as well as the latitude/longitude. Then, you can open one in the Maps app by calling openInMapsWithLaunchOptions: on it.
Related
I'm looking for certain POIs using their confirmed coordinates but the Here entrypoint from Place Search API (/discover/here) doesn't provide all POIs which I could manually find in the HERE WeGo web-app.
At the beginning I thought maybe this is because the default categories are set to eat-drink, going-out and shopping? I have provided an additional parameter (cat) to my request with all the categories, but this gave me even more missing POIs.
Does anyone know why there is a such difference between the web-app and API service?
The here-wego app doesn't use the "discover/here" endpoint so this won't show you the same results. It uses "discover/search".
The discover/here entrypoint was designed for a different use case and its behavior is a bit odd. It was set up for "check-ins", so it isn't guaranteed to return everything in an area.
If you want to provide your users all of the POIs in an area, you should use the browse/ endpoint. I know that requires them to specify categories, but it's really the best choice.
Alternatively, depending on your use case, you can call discover/search the same way you called it by using the here-wego app (same query and search center).
I am working on an iPhone map application and wanted to know whether it was possible to request any labels visible on Google Maps given a longitude/latitude and radius?
For example if I gave the following location to this Google Maps API, I would get back McCullough Hall, Moore Hall, etc. The list would be any place labels visible on the map (doesn't have to be just restaurants, businesses).
If this is possible can you direct me to where I can learn more about this. If this isn't possible, can you direct me towards another API where it is possible?
Look into Googles reverse geocoding, I think that's what you're looking for.
The short answer, you cannot!.
The only way is to search for places by name and get a reference key to query the place details including lat/lng. Not the other way around.
IMHO, this is mainly a policy of Google instead of being technical limitation.
I am trying to find the long and lat of a city on the iphone. Say the user is searching for London, I would call some function that would retrieve the long and lat of London. I have looked on the web and found you can use a Google API but there must be an Apple function somewhere to handle this?
I have come accross the MKReverseGeocoder which takes the long and lat and tells you what city you are near. e.g.
// reverse geocode the user location
geocoder = [[[MKReverseGeocoder alloc] initWithCoordinate:mapView.userLocation.location.coordinate] autorelease];
If it can reverse the process there must be some form of MKGeocoder class?
but there must be an Apple function somewhere to handle this
Why must there be? Because there isn't.
There are a number of web services you can use (e.g. Google) or you could download a place name database such as http://www.geonames.org/ and import it into your app. It's probably best to import it into an SQL database which you can then search from your app.
See OpenStreetMap. It gives you more flexibility in accessing its data. You could pre-populate a CoreData store with the informations you need.
There are some api-clients, i.e. route-me or cloudmade.
The iOS5 SDK has added support for both forward and reverse geocoding. Take a look at at the CLGeocoder class class for more info.
First, give up that there "must be" an Apple way. There really isn't. If you don't believe me and my nearly 2k of experience points, listen to Ole and his 13k.
There are three services I've seen.
I tried Google's geocoding API. It's decent, but a bit complicated, and they throttle your queries pretty harshly.
Then I tried MapQuest's, which I found to be surprisingly excellent. I have two apps bound for the app store in the next month or so that use MapQuest's API.
Then I found Geonames, which I'm very impressed by but haven't had the opportunity to use yet. Note that Geonames DOES allow you to download their data, so if you really need network-free service, this might be a solution.
Apart from that, you're going to be calling something off the device. Which, by the way, you are when you use MKReverseGeocoder--that's just a wrapper around Google's reverse geocoding service.
I am passing a link on the iPhone with google map instructions:
http://maps.google.com/?q=Cabelas&mrt=loc&sll=30.444064,-97.813874&spn=0.006313,0.01133
In a browser, this works great, centering the map in my area and bringing up the store near us. But on the iPhone, when the internal maps application intercepts the call, I get a view of the US, most of the params are being ignored.
Can anyone spot any reason for this, or have a reason?
See the Apple URL scheme reference for the rules for Maps links. Especially:
All parameters must be supported.
Since the mrt parameter is not supported, I suspect that one is the problem.
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.