Google Maps iOS SDK for Directions - google-maps-sdk-ios

Is it possible to use the Google Maps iOS SDK to show a user the direction from his position to another location within my app (i.e. in another UIView, and not using the URL Scheme to pass the direction request to the Google Map app)?
Many of my users don't have the Google Map app on iPhone, however the directions Google provide are much more accurate than Apple's map, hence my necessity to show the direction within my app.
Comments appreciated.

To display Google Maps (even using the SDK) users need to have the Google Maps app installed.
You can test whether this is the case using:
[[UIApplication sharedApplication] canOpenURL: [NSURL URLWithString: #"comgooglemaps://"]];
If it returns false, you could prompt users to download Google Maps.
The SDK can be used to display a poly line from the users current location to some other point, however it cannot (at this stage anyway) provide turn-by-turn directions inside the app, for that you do need to use the URL scheme.

Related

How to find distance between two coordinates using google maps SDK for ios?

I have an ios application which uses default Apple map for displaying selected records on map. Now I have to add a button "Drive Route" which launches google maps installed on device and show direction from current location to selected records .I already did this by using Google Maps URL Scheme for ios.
Now i want to know the distance and Travel time between selected records and current location. I found that we can do this by using Distance Matrix API like this :
"https://maps.googleapis.com/maps/api/distancematrix/json?units=metric&origins=(a_coordinate_string)&destinations=(b_coordinate_string)&key=<#GOOGLE_API_KEY#>"
But I want to use Google Maps SDK methods to get desired result.
NOTE : I have used Places SDK for ios , where we have Methods AutocompleteQuery () etc.
Does Google Map SDK provide any Methods to get desired Distance and Travel time?
Please, help me.
Thanks in advance.
Google Maps SDKs currently do not have this kind of feature. You will need get the results programmatically via Distance Matrix Web Service request.
If you would like to have this feature available in the Google Maps SDKs, you may file this as a feature request in Public Issue Tracker:
https://developers.google.com/maps/support/#issue_tracker

Ionic2/3: Is it possible to open google map APP by passing custom lat- long?

Currently i am working with ionic 3 project.
I have latitude and longitudes of particular location and want to get root of that location using google map Mobile Application, Just want to open that location by navigating to google map app.
do anyone here with any suggestions or idea ?
Thanks
As of 2017 the recommended by Google method is the Google Maps URLs:
https://developers.google.com/maps/documentation/urls/guide#directions-action
You can create a cross-platform universal URL for Google directions following the documentation and use the URL in your intents. For example the URL might be something like
https://www.google.com/maps/dir/?api=1&destination=60.626200,16.776800&travelmode=driving
You can use Ionic Native Launch Navigator now to load the native maps app to a destination. You can specify the app launchnavigator.APP.GOOGLE_MAPS or the user can specify.
Pass the lat long as first argument as shown here
this.launchNavigator.navigate([50.279306, -5.163158], options)
.then(
success => console.log('Launched navigator'),
error => console.log('Error launching navigator', error)
);
The recommended by Google way is using the Google Maps URLs API:
https://developers.google.com/maps/documentation/android-api/intents
Using Maps URLs, you can build a universal, cross-platform URL to launch Google Maps and perform searches, get directions and navigation, and display map views and panoramic images. These universal URLs allow for broader handling of the maps requests no matter which platform the user is on.

GPS in Google Maps API

I have an application with a Google map. I traced the routes with address history to follow to go from one point to another. I would like to implement GPS service on my map, like Google Maps application mobile, which will go running for both voice and by visualization. My APP is in HTML5 and in javascript, not in native.
Basically, I would like to do this with Google Maps Api or something like that:
Thank you and sorry about my english.
Please check the Google Maps API for the recommended use of directions https://developers.google.com/maps/documentation/directions/
Alternatively if you have a Android / iOS App and want to open google directions through an intent, check the documentation for Google Maps Intents for Android or Google Maps URL Scheme for iOS respectively

Turn by Turn GPS Navigation on Android Using Android Studio

I want to use the Tun by Turn voice navigation feature that on google maps app in my android app, I've searched a lot but couldn't find answer, I've used google maps direction API for creating the path from the current location to the user's destination, it's part of the idea of the application to help the user navigate,
What API should I use ? or is it even possible to do it?
Google Maps API v3 does not provide the voice feature at all. And Google Maps API v3 and Google Maps applications are completely different ones. So if you want to implement the voice navigation, you need to prepare it.
Best to read the terms of service. 10.4 (c) ⅲ might be relevant:
ⅲ. No navigation. You will not use the Service or Content for or in connection with (a) real-time navigation or route guidance; or (b) automatic or autonomous vehicle control.
Fortunately, org.apache.cordova.plugin.tts plugin provides that function for Android.
document.addEventListener("deviceready", function() {
tts.speak("Hello");
});
Please refer to the link:
https://github.com/domaemon/org.apache.cordova.plugin.tts
Hope it helps.

How can I link to a Google Maps directions url with the user's location already plugged in?

I was browsing Foursquare recently and they have this neat feature where you can click "Bigger Map" on their map, and it plugs your location in to Google Maps directions to the venue. I was wondering how I could replicate the functionality. (A high level overview is sufficient, I just can't seem to find it in the docs.)
It's not in the docs because it's not a Maps function. If you're talking about the Google Maps API, which is what Foursquare uses, they're detecting position using your device. I'm guessing for browser operations, they're using HTML5 geolocation. Here's a demo of just plain geolocation: http://html5demos.com/geo. That will ask the user to share their location with the app. Once you have that, you plug it into the Google Maps API Directions Service.