Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings

Mobile Client - Open mapping applications when selecting an Address

Status: Delivered in 8.0
by Copper Super Contributor alex.cottner on ‎01-16-2012 10:07 AM

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.

Comments
by tskidmore
on ‎01-16-2012 12:18 PM

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/blob/master/src/Environment.js

 

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:

http://developer.apple.com/library/ios/#featuredarticles/iPhoneURLScheme_Reference/Articles/MapLinks...

 

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).

by Copper Super Contributor alex.cottner
on ‎01-16-2012 12:55 PM

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?).

by tskidmore
on ‎01-16-2012 01:52 PM

Unfortunately you are correct, it didn't make the 1.2 release -- it will be standard in the next release for sure though.

by Gold Super Contributor RJLedger
on ‎01-16-2012 04:22 PM

@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. 

by scottdurgan
on ‎01-26-2012 02:41 PM
Status changed to: Implemented
 
by scottdurgan
on ‎01-26-2012 02:56 PM
Status changed to: Implemented
 
by Moderator Moderator
on ‎08-02-2012 12:07 PM
Status changed to: Delivered in 8.0
 
by Copper Super Contributor alex.cottner
‎09-21-2013 10:39 AM - edited ‎09-21-2013 10:40 AM

I was working on my DevTap project today using Mobile 2.2. I've noticed that this doesn't seem to work anymore. My testing was on my HTC Droid DNA. User Agent string is..

Mozilla/5.0 (Linux; U; Android 4.1.1; en-us; HTC6435LVW 4G Build/JRO03c) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 Mobile Safari/534.30

 

Looking at Environment.js, it appears we're back to just popping google maps. For my Devtap project I've just overridden this for now. I'd like to see this be included again by default. Here is what I'm using right now. I don't have any iOS devices at home to test with, so that part could be wrong.

 

if (navigator.userAgent.match(/Android/i))
    window.location.href = string.substitute("geo:0,0?q=${0}", [address]);
else if (navigator.userAgent.match(/iPhone|iPod|iPad/))
    window.location.href = string.substitute("maps:q=${0}", [address]);
else   // web browser
    window.open(string.substitute("http://maps.google.com/maps?q=${0}", [address]), '_blank');  

 

 

We want to hear your cool ideas for enhancing 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
Read our submission guidelines.

Two
Search for your idea. If you don't see it, submit a new one!

Three
Provide feedback on the ideas of others by voting with kudos and adding comments.
For more information about using ideas, read this thread.

Four
Track your ideas and those you like. Once you've posted or kudoed and idea, subscribe to be notified via email of the latest updates to the idea. From within the idea, click "Idea Options" which appears above the idea title and choose, "Subscribe to this idea".

Be sure to check back from time to time to see new ideas and status updates!

Here is a quick list of the recent ideas for speedy browsing!
Labels