
So right now the mobile client just opens google maps in a web browser when running the "showMapForAddress" function. It sure would be nice if it opened the native mapping application. I already use this, but it would be nice if it was included in the stock mobile client.
showMapForAddress: function(address) {
if (navigator.userAgent.match(/ (android) /))
window.location.href = String.format("geo:0,0?q={0}", address);
else if (navigator.userAgent.match(/ (iphone|ipod|ipad) /))
window.location.href = String.format("maps:q={0}", address);
else // web browser
window.location.href = String.format("http://maps.google.com/maps?q={0}", address);
}
This just does a browser check and returns a hyperlink accordingly. If you're on Android it will open your default mapping application (normally Google Maps, but you can change it to be another App). If you're on iOS it opens the google maps application. And if you're on neither it just redirects you to google maps as normal.
This was indirectly added in the next release (current Master branch on github) - the defect being clicking an address should open a separate tab versus changing the URL of the current window.
You can see the code here (note this uses the dojo framework):
https://github.com/SageSalesLogix/argos-saleslogix
Since it is firing a native event on the link it will follow whatever the system states that link should do.
iOS - opens Maps if installed, else uses browser:
Can't find a source for Android, but from testing it launches the "please select an app to open this with" dialog with Browser/Google Maps in the list (plus other browsers/map apps).
Thanks, I was hoping this would become a stock thing. So it looks like this isn't in 1.2 (at least it doesn't look like it is on GitHub) so I'm guessing this will be released with 1.3 (or maybe included in SLX 8?).
@Alex - Just made your change to the (1.2) source code in are deployed on our production db..
Works GREAT w/both desktop FF/Chrome and on the Samsung Galaxy 10.1 droid tablet!. Just what was needed.
I'm going to change ALL of our customer systems and add this to their 1.2 deployments.
You must be a registered user to add a comment here. If you've already registered, please log in. If you haven't registered yet, please register and log in.
We want to hear your cool ideas for enhancing Sage SalesLogix products and services. So add your own ideas or kudo (vote) on the ideas of others here! Watch the most valuable bubble to the top!
I have an idea! How do I get started?
One