Clickable Link to Custom Route from Google Maps web to iOS app - ios

My first question here. I'm hoping I'm doing the tags and such correctly so the right folks might be able to see this. If this question should be placed in other area, please let me know.
I'm trying to create a link to a set of custom driving directions that, when clicked from the native iOS Mail app, will open the Google Maps iOS app and populate the custom directions.
I have a map which has driving directions from Point A to Point B, but I've significantly revised the route using the click and re-position functionality in Google Maps (web).
Using the share function from Google Maps (web) creates a link that does in fact retain the custom route, which can be seen when the link is clicked and it opens in Safari. I don't mind that it opens in Safari, since at this point it prompts you to open up these directions in the Google Maps app. But here's where it gets muddy.
When you click the "use the app" button from Safari, the custom route does not carry over to the app. You are shown default route choices based on Point A and B.
The Google Directions API section on Waypoints and using the 'via:' prefix seems like the best way around this, but I'm not sure how I'd turn that into something clickable from an email.
For reference, here is one of the maps I made with a custom route. Basically I want to have it go from Point A to B along one road. I had to make a handful of points along the route in order to keep the route on the same stretch of road.
Further complicating this is Google's attempt to reroute even this map, based on real-time traffic. I went back to this link after copying it here to find out there's an accident on this road right now and it's re-routing through side streets.
Any help would be much appreciated.

Well, you can open the google maps as it follow as it is documented in the documentation:
comgooglemaps://?saddr=Google,+1600+Amphitheatre+Parkway,+Mountain+View,+CA+94043&daddr=Google+Inc,+345+Spear+Street,+San+Francisco,+CA&center=37.422185,-122.083898&zoom=10
However, there is no mention on how you can add waypoints. And, indeed, you can not even do it in the Maps App. So there is basically nothing we can do...
BTW, here is a blog where included some work arounds, hope this helps a little.

here is what i do : long method, but it works.
open google my maps (instead of google maps) and make your custom route.
in options, export your route to KML/KMZ
at gps vizualizer com, convert your route to the format your app accepts.

Related

Open Google Maps place on iOS with Universal Link

I'm using Universal Links to open a place in Google Maps since I don't really see another way.
I create a normal Google Maps links like this, which on web resolves to a place:
let urlString = String(format: "https://www.google.com/maps/place/?q=place_id:%#", annot.cafe.google_place_id)
Then I tap it on iOS and get Google Maps opened with the error that no such place could be found.
Should this work? Is there some other way to focus a specific place on iOS Google Maps?
Turns out this is possible using a search URL construction as specified here: https://developers.google.com/maps/documentation/urls/get-started#search-action
The constructed URL needs to have both the query with the lat/lon coordinates in it and a query_place_id with the place id.
It looks like this:
https://www.google.com/maps/search/?api=1&query=52.504875%2C13.394549&query_place_id=ChIJoaO7QRRRqEcRtBLLz6p4PS0
That creates the desired behaviour of the map going to the location and displaying details for the given place.

Options for displaying multiple routes on iPhone Map (iOS 4+)

I am trying to develop an iPhone app (with map routing function), and I need everyone's suggestions (guidance).
Below are a few specs:
The app will be running on iPhone with iOS 4+.
The app will have Map functionality.
In the app, given a "few locations" in a given order (to make things less complicated), the Map will draw routes between each locations on the Map.
Clicking on any location will display another page that shows some information about that location.
Can choose alternative route between two location (which I don't think is possible, but let me know if anyone know any framework that can do this).
I did some research, using Map on iPhone is easy using MapKit (and it's available after iOS 3.0). I followed this tutorial, and everything seems easy. However, if I want to draw routes on my map, I will need routes data in a CSV format. However, I do not have those data (yes! I suck).
And prior to iOS 5.1, MapKit use Google Maps, and I read somewhere that in Google Map's term and condition of use, it prohibit people from drawing on the Map (correct me if I am wrong).
In order to retrieve route data, I would imagine that I will have to get it through Google or Apple (I don't know if it's possible). I'm just wondering if Apple Map or Google Map have API to retrieve these?
If not, an alternative I came up with is to use a webview, and display my Map routes on Google Map. I'm just wondering if Google Map API will allow me to insert multiple locations and display all the routes?
I really need some suggestions... I am getting buried in all these problems.... thank you
Follow this sample - MKOverlay is the way to go. One more example is here.

Google Places API Violation

I am using Google Places API to pull a list of resturants, and I am displaying them on map. However, since Apple has switched there map services over from Google in iOS 6.0, I am now in violation of Google's terms of use, which states that you must display Google data on a Google map.
"If your application displays Places API data on a map, that map must be provided by Google."
https://developers.google.com/places/policies#terms_of_use
I obviously need to change the map, because I am not going to release an application that is in violation. Any thoughts or suggestions on what to do? Should I go Google Maps with a web view? Does apple have some sort of Google Places API alternative?
Edit:
Using Google Maps through a web view is a hassle, i'd like to find an alternative to that, although it would technically work.
I decided to use Google Maps JavaScript API. Although, it is a little more difficult to deal with, mainly the JavaScript through Objective-C, it is a solution. The map is displayed through a web view, and I use JavaScript to interact with the map.
https://developers.google.com/maps/documentation/javascript/tutorial#api_key
I will wait to accept this answer, to see if anyone else has any thoughts. I just wanted to post this, in case it helps someone else.
Edit:
Google recently released a Maps SDK for iOS, this is the better solution now.
https://developers.google.com/maps/documentation/ios/
I would try to directly contact Google, explaining the situation, and ask them for written permission to use Apple's maps. This is more a legal question than programming. One would think that Google is aware that you can no longer display their maps using Apple's API and that, even regardless of the map, they would want you to use their places, as doing so generates advertising revenue for them.
Agree with #Owen here - you could get permission to leave your app unchanged until some possible future date when you might have to change it, or could you definitely go to the effort of changing it now and then possibly have to change it again in the future for some other reason.
If you could get a 100% guarantee that you could change it once and never have to change it again then I'd say do it now, but nothing's certain.

Route Map Direction on Bing Maps in Windows Phone 7?

How to show the Route path from one place to another place using bingmaps in WP7?
i am having user starting latitude,longitude and destination latitude,longitude values...
Please tell me....any samples please let me know...
thanks in advance
It will depend on your needs and if you wish to customise your "Map".
There are two options available:
Use Bing Maps Direction Task - (very good, quick tutorial)
Use the Bing Maps control in your app - (you will need to sign up for a developer account, then follow the tutorials on how to call the various services to get route information based on start and end points and then finally show them on the map)
number 2 is more challenging, however will offer much greater levels of customisation

Google Maps Native App - Map Links

I want to open the native google maps application on a mobile device from my mobile website. Currently I am using the URL http://maps.google.com/maps?q=The%20Diner,%2027%20Main%20Street,%20The%20Village%20#55.7665863,-4.1455545, which works for one location.
What I am looking to do is show multiple locations with a different coloured marker. Is this possible.
Well i found when you use the non-secure url and post a list of postcodes it works fine you can add more postcodes by adding another +to: ;
http://maps.google.com/maps?f=d&source=embed&saddr=LD7+1EN&daddr=CH1+3AE+to:AB12+3AX&
havent really tried to make it do different markers with different colors or anything, but i suggest looking at the url generated by your browser in google maps and ensuring its not a https:/ link and i think it should work.
Is it possible to use google static maps in place of what you have?
This page shows a static map example with multiple markers.

Resources