So far my reaserch revealed that for Android I will have to use a link in this format:
<a href="geo:38.897096,-77.036545">Geolocation Test</a>
This is problematic because I will have to use an external service to convert the address into longitude and lattitude coordinates , wich is something I would like to avoid if possible.
In the case of iOS this is alot simpler.I only have to give it a link in this format:
<a href="maps:q=Bacau">Test 2</a>
And the native map app get's oppened.
Is there any way , similar to the one in iOS , for Android to give it a plain link with an address in a specific format and the device will know to open it's native map app?
Cordova 3.6.0 introduces a second whitelist, for restricting which URLs are allowed to launch external applications. In previous versions of Cordova, all non-http URLs, such as mailto:, geo:, sms: and intent, were implicitly allowed to be the target of an a tag. Because of the potential for an application to leak information, if an XSS vulnerability allows an attacker to construct arbitrary links, these URLs must be whitelisted as well, starting in Cordova 3.6.0.
So you need to add explicitly in the config.xml:
<access origin="tel:*" launch-external="yes" /> <access origin="mailto:*" launch-external="yes" />
Looking at the Android intents list it should be possible using the
q parameter within the
geo: URI space.
©2020 All rights reserved.