What is the standard/best way of route implementation on iPhone? - iphone

I have read about a number of posts for developers who want to plot out a route on a map on an iPhone but there is no satisfactory answer as how to best achieve this. You can use the Route-Me library, add a layer on top MKMapView or send coordinates to phones map software then you navigate from your application, which in my opinion is bad user experience.
None of this solves the problem in a good way.
Some Post writes that there are legal obstacles, others write that it is about licensing money. This must be a very common requirement and thus a common feature to implement. So what is the de-facto standard way to do this?
Can someone with good experience share their insights on this question?
BR
//Christoffer

So I decided to use Apple Developer Technical Support to really clear this out. This is the reply:
Hello,
Thank you for your inquiry to Apple Worldwide Developer Technical Support.
I am responding to let you know that I have received your request for technical assistance.
The de-facto standard way of doing this is using the Map application. I realize this is not what you want. You want to stay within your app. The MKMapView API does not give you that level of support when it comes to user directions. You will have to rely on a separate web service to obtain those directions, then plot each lat/long point yourself on the MKMapView. Basically you will need to make an HTTP request to the Google Directions API. The terms require you to display the results on a Google map; since MKMapView shows Google, that should be OK.
http://code.google.com/apis/maps/documentation/directions/#DirectionsRequests
If you succeed in obtaining driving directions from let say Yahoo or Google service, MKMapView will allow you to plot a visual course using an MKOverlayPathView and MKShapes to draw polygon-like shapes. Apple has a sample called "KMLViewer" found at
http://developer.apple.com/library/ios/#samplecode/KMLViewer/Introduction/Intro.html
It shows you how to plot points based on KML. The approach is the same since we are dealing with lat/long coordinates.
You may want to consider using the Map application, which would be considerably easier. All you need is this:
// for lat/long directions
NSString *urlString1 = #"http://maps.google.com/maps?daddr=37.324885,-122.032378&saddr=37.332094,-122.03124";
// for address directions
NSString *urlString2 = #"http://maps.google.com/maps?f=d&source=s_d&saddr=1+Infinite+Loop,+Cupertino,+CA+95014&daddr=Mandarin+Gourmet,+Cupertino,+CA&hl=en&geocode=FcajOQIdYvO5-Ckbd16TtrWPgDFAc4Pi50E92A%3BFZ2GOQIdLe65-CHRv0sTH7YegykLqKn9rbWPgDGUnqKbIqi1Bg&mra=ls&sll=37.325567,-122.032989&sspn=0.007243,0.007285&ie=UTF8&ll=37.328195,-122.031466&spn=0.007243,0.007285&z=17";
[[UIApplication sharedApplication] openURL: [NSURL URLWithString: urlString1]];
SECOND E-MAIL:
Just to be clear in my last e-mail about the terms for using Google services. Google requires you to display the route results on a Google map, which MKMapView uses. However, I would double-check Apple's own T&Cs regarding the use of external services like user directions on MKMapView itself. I don't want you do go down a path only to find legal restrictions along the way.

Related

How to get polygon co-ordinates for a location searched on google maps. Maps API

I want to know if there is any way to get a city/suburb/postal code's outer boundary coordinates, so as to be able to draw a polygon on the map.
I have read through the google maps API documentation (Places, Maps, and Routes) and I can't find anywhere where they provide this information.
Native in google maps if you search for a city google maps will draw a polygon around the city edges. Drawing the polygon is not the issue I just want to know how to get the polygon points for any given location.
I have searched and all the available answers are either very old or provided only a community maintained polygon database, that is not guaranteed to have your location mapped.
So my question is, do google maps APIs expose some function to get these coordinates, or is there some reputable well maintained service where this information can be obtained from?
I am using it in a flutter applicant making use of google_maps_flutter.
These are some of the resources and other links I found but seem dated.
Resource 1
Resource 2
Googles Docs
Please please help.
I'm not sure that the Google Maps API offers this functionality, but I trust that you've dug through enough of their documentation to find that they don't.
I suggest looking at Nominatim, which queries data from OSM (OpenStreetMap). They're free to use and community-driven - which can be both awesome and scary (eg. you can't assume "permanent ID"s for the things you query)
Relevant Links:
https://nominatim.org/release-docs/latest/api/Overview/
https://nominatim.openstreetmap.org/ui/search.html
Otherwise, you could also try looking for other tools that allow you to download datasets of boundary coordinates (eg: GADM) but you'd have to find one that has the level of granularity you need and read up on their usage policies (most disallow use for commercial purposes).
Unfortunately the world of GIS and digital cartography is one that can get pretty complicated and that I'm no expert in, but I hope this helps somewhat.
Listing other resources I've found that are rather outdated, but could still be helpful:
Google Maps how to Show city or an Area outline
Add "Search Area" outline onto google maps result

Bing Maps, can I use aerial imagery to edit my data like Waze?

I want to create a web interface where I can adjust my own "street" data to match aerial images of streets so that it is more accurate. I will have someone who is on the street, will see that it is inaccurately represented on my map and then they will go to the web interface to update it.
I understand that Waze used Bing aerial tiles to do this in their map editor (https://www.waze.com/editor/) before they were acquired by Google. Is this sort of function still available from Bing?
My worry is that maps like Google or OpenStreetMaps do not allow for you to "trace" their aerial tiles. Although this is a question of legality in the case of Bing, I am more interested in suggestions for mapping services that would allow me to integrate this functionality into my web interface.
Note: I am not taking answers here as legal advice. I understand that I am legally liable for whatever I chose to do, I am just looking for suggestions on an aerial map I could use for my project.
Thanks :)
It depends on what the base map data is. Bing Maps already provides OpenStreetMaps with aerial imagery which can be used to trace roads in their editor tool. I can't see OpenStreetMaps disabling this any time soon as long as Bing continues to provide them with access to the aerial imagery.
Send me an email at richbrun at microsoft.com and we can discuss in more detail.

Showing nearby specific business offices in table view cells using iphone GPS

There are lots of similar questions but my question is different in that sense i got coordinates of my current location in my application.
But now i want to show specific business offices in table view around that coordinates. I know ReverseGeoConding is answer to that but i cant find suitable tutorial or advice on this. How can i implement it.
Please suggest .
Reverse Geocoding will provide you with address information for the coordinates provided. In order to get businesses around those coordinates, you may want to look into external APIs. I believe Facebook has a Places API and Foursquare has an API as well. These may be able to provide you with local business information.

How to find Location using Zipcode?

I am new iphone developer,please help to me.how can i find particular shops list in particular Zip Code.. that means i need to place pins in Some shops by searching Zipcode
Thanks in advance
I'm not sure there's a definitive "Right Way" to do what you're asking, but if it were me...
I would probably use Google's Places API to get a list of so-called Places (I gather this includes a fairly comprehensive list of businesses, as well as other points of interest) near the user. The API requires lat/long coordinates to resolve the list, you could either get that data from the user's iOS device (I don't develop for this platform so I can't give specifics) using Apple's location API, or if you really want to do a lookup by zipcode you might want to look at Google's Geocoding API. Keep in mind that Google's services are by no means the only game in town, and there are certainly other ways to do what you ask. But if it was me, this seems like the simplest solution

Mapkit routes and google license [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about programming within the scope defined in the help center.
Closed 7 years ago.
Improve this question
So, this question is not if I can do routing with mapkit. You can't with the API. So I found the clever way of using an annotation to render a route between two points. The route is based on a series of lat/long values. In my app, I use it to render a route (but not for vehicles or walking). There is no list of directions, so it's not turn by turn. Just shows the line on the map.
This may be more legal, but does this violate the license? Is there the possibility that my app could be rejected? This is a very big deal for my app. Has anyone gotten a commercial app out using this method?
You should not be allowed to display a route on top of the map. The terms state clearly that you are not allowed to display route guidance.
http://code.google.com/intl/de/apis/maps/iphone/terms.html
10.9 use the Service or Content with any products, systems, or applications for or in connection with:
(a) real time navigation or route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device;
(b) any systems or functions for automatic or autonomous control of vehicle behavior; or
(c) dispatch, fleet management, business asset tracking, or similar enterprise applications (the Google Maps API can be used to track assets (such as cars, buses or other vehicles) as long as the tracking application is made available to the public without charge. For example, you may offer a free, public Maps API Implementation that displays real-time public transit or other transportation status information.
You may want to look at http://www.cloudmade.com
and the route-me library which gives you much more freedom.
What you want to do seems like it is OK, as long as when you are showing routes you do not display the user position. I am basing this on the docs here (linked to from the MKMapView documentation):
http://code.google.com/apis/maps/iphone/terms.html.
that state you cannot:
10.9 use the Service or Content with any products, systems, or applications for or in connection with:
(a) real time navigation or route guidance, including but not limited to turn-by-turn route guidance that is synchronized to the position of a user's sensor-enabled device;
(b) any systems or functions for automatic or autonomous control of vehicle behavior; or
(c) dispatch, fleet management, business asset tracking, or similar enterprise applications (the Google Maps API can be used to track assets (such as cars, buses or other vehicles) as long as the tracking application is made available to the public without charge. For example, you may offer a free, public Maps API Implementation that displays real-time public transit or other transportation status information.
Even that language I feel is a bit fuzzy on if you can show user location or not along with routes, if you do not adjust the map coordinates automatically to follow the user.
Given the inconsistency of the app store approval process, what got through for one person may not get through for somebody else.
I believe the only requirement of the MapKit license (which is from Google and not Apple) is that you do not sell an application that features only a map + additional features built around the map. If the map feature was just a small piece of the application then it's fine, I believe.
I don't think that Apple will enforce this when approving apps, though. Unless you're using undocumented/underground API then you should be fine getting through to the App Store.