Google Map is now available in Appstore for IOS 6. I have a application which utilises MAPKIT and WebView to show Driving direction using Google webservices.
For showing Route in Native Apple MAP app, i use codes similar to this..
MKMapItem *mapItem = [[MKMapItem alloc]initWithPlacemark:place];
NSDictionary *options = #{
MKLaunchOptionsDirectionsModeKey:MKLaunchOptionsDirectionsModeDriving
};
[mapItem openInMapsWithLaunchOptions:options];
I want to show Route to the user in the New Google MaP App installed on user device, embeed its UI within a View in my app.
Do guide me.
Goole have released latest API for IOS 6.0 and up.
For that follow the step below
You have to registered your app and get the keys from Map IOS access.
Refer the following link for further detail
New way to add google maps in iOS 6 app
For displaying the directions within the GoogleMaps app, using the new GoogleMaps URL scheme along the lines of:
comgooglemaps://?saddr=Google+Inc,+8th+Avenue,+New+York,+NY&daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York&directionsmode=transit
Taken from the documentation should help you. A short browse from there, you will also notice that Google have released an SDK for the new GoogleMaps, with access tokens being rolled out slowly. Doc
seemed to cut off the end of my answer, but #Hi Ren has filled in the end with the link to the documentation to the new SDK.
Related
I want to show directions from my current location to an address in my app.
I can successfully open the directions by using:
Get directions
But once open I cannot return to my app. Is there a way to close the map again?
*note I appreciate this will only work correctly on iOS, I will handle android separately.
you should be able to do it with comgooglemaps-x-callback:
https://developers.google.com/maps/documentation/ios/urlscheme#specify_a_callback_url
this example opens Google Maps on iOS with a call back to chrome:
comgooglemapsurl://maps.google.com/maps?f=d&daddr=Tokyo+Tower,+Tokyo,+Japan&sll=35.6586,139.7454&sspn=0.2,0.1&nav=1&x-source=Chrome&x-success=googlechrome://?resume=true
I am developing an iOS app which integrates google maps iOS sdk .
In my GMSMapView I have dropped a GMSMarker, I want to set the title of the marker with location name . I have tried GMSAddress, GMSGeocoder and GMSReverseGeocodeResult but I could not get the exact location name. How can get the complete address of the current location.
This post should have what you're after. Basically upgrade to v1.7 and use GMSAddress
The linked post includes a code sample you can use as well.
My Iphone app needs to open the google maps application to use the StreetView and the directions mode.
All works fine,But my question is, is there any way of adding a button or something to go back to my app?. I have seen that with UIWebViews maybe thats the only solution..
Thanks in advance
My answer comes from this documentation: Google Maps SDK for iOS, Google Maps URL Scheme
You may add a back button if you register a custom URL scheme for your app and use the comgooglemaps-x-callback:// url scheme to launch the Google Maps iOS app.
Here is a great tutorial for iOS Custom URL Schemes.
The following string would open Google Maps with directions to JFK airport and would add a button in Google Maps with the title "AirApp".
Touching that button would call the custom url scheme sourceapp:// which you would set up by following the tutorial I linked to above.
#"comgooglemaps-x-callback://?daddr=John+F.+Kennedy+International+Airport,+Van+Wyck+Expressway,+Jamaica,+New+York&x-success=sourceapp://?resume=true&x-source=AirApp"
I've got an issue with an app builded on phonegap build (build.phonegap.com) on iOS with Phonegap 2.3.
I'm trying to open the native map application with this link :
<a id="gmap_image" href="">
</a>
The js code that sets the href attribute :
$("#gmap_image").href('http://maps.apple.com/?q='+$xml.find( "adresse" ).text());
I've seen that for opening native maps application with a link, i have to give an url based on maps.apple.com domain (Apple Map Links).
But when I click on the link, all that happens is that the page refreshes (and I don't know why it refreshes too because no code asks to do it).
Has someone an idea ?
Regards,
maybe it's too late, but i had the same issue.
Try this way:
$("#gmap_image").href('maps:q='+$xml.find( "adresse" ).text());
just change http://maps.apple.com/?q= into maps:q=
that works for me
You can launch the google Maps app on an iOS device using this header in the URL Scheme. comgooglemaps:// This is according to the developer documentation found here. https://developers.google.com/maps/documentation/ios/urlscheme
for example a web link to open the Google Maps app in iOS6 and get directions from New York to Washington DC would look like this.
Directions from New York, NY to Washington DC
Try this one
$('#map').bind('tap', function(){
var url = 'http://maps.google.com/maps?';
url += 'q=[place_name]'; //add ur querystrings
// open the native maps app by calling window location
window.location = url;
});
Unfortunately, this is a no-go on iOS 6, since Google maps is no longer "natively" part of the OS.
Though you can still launch Apple Maps, since this is supported natively.
If you are using one of the latest PhoneGap/Cordova versions, it seems that it's not longer possible to open safari or maps from standard "a href=xxx" tags.
In order to open maps, you will need to attach a click event and open the link using:
window.open('http://maps.apple.com/?q=whavever', '_system');
within Phonegap, window.open() will open a link with a new in app browser, but, if you specify '_system' as the second param, it will send the URL to the OS (thus, opening the maps app in this situation).
I have a google map that I created with KML:
Here is a link to the map:
http://goo.gl/maps/dkfjU
Here is the complete KML file:
https://dl.dropbox.com/u/94943007/02bb39645a3c9d95afeed5cb9bd5d07c040d8ca8a4ee56b9fb367d38.kml
When browsing this map with my IPAD using safari, for some reason when I tap anywhere on the map, it creates a point there on the map.
How do I disable point creation on the map so that IPAD users are not able to do this?
I checked the link as well and Marcelo seems to be correct. To have a maps with the ability to turn on and off layers you will need to build your own site and perhaps use Javascript and the Google-maps API to build it. Maybe start here: https://developers.google.com/maps/documentation/javascript/tutorial
You cannot disable adding a place mark if you are browsing the map in safari
You can control it if you use map kit iOS API of the iOS SDK.
For importing KML-Data into that SDK, you can use Sample Code from
Apple:
http://developer.apple.com/library/ios/#samplecode/KMLViewer/Introduction/Intro.html
But there is no built-in KML Import in iOS SDK. You can use other
frameworks as mapbox/Simple-KML here
https://github.com/mapbox/Simple-KML
If you want to do this in safari, then you're lost, unless you can manipulate that using JavaScript!!!