Monaca is developing a hybrid app that supports both Android and IOS.
When I press the link, I want to pass the coordinates of the current location and destination so that the Google Maps installed can be opened, and the Google Maps navigation system can be executed with the coordinates given.
Now
window.open('http://maps.google.com/maps?saddr='+start'
+ '&daddr='+end+'&directionmode=driving', '_system');
I'm using this kind of code like this.On Android, when you press the link and the code above moves, you will see a dialog asking if you want to connect to the Internet or connect to the Google Maps app installed.However, IOS is having trouble connecting Google Maps using safari.
How can I open Google Maps with both Android and IOS?
For iOS, use comgooglemaps:// instead of http://
to open it in the Googlemaps app.Please refer to Google's official documentation.
https://developers.google.com/maps/documentation/ios/urlscheme
However, I cannot open it well on Android, so I think I will use monaca.isIOS()
or monaca.isAndroid()
to branch the process.
607 Uncaught (inpromise) Error on Electron: An object could not be cloned
599 GDB gets version error when attempting to debug with the Presense SDK (IDE)
572 Understanding How to Configure Google API Key
886 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
© 2024 OneMinuteCode. All rights reserved.