• CbCloud Usisaude
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am using a Js code to get coordinate locations in a visual force page.
I put this page on salesforce mobile App, and i can get locations using Ios Phones, but doesnt work on Adroid phones, any Help?

Js code:

   <script>

        $(document).ready(function () {
            if ("geolocation" in navigator) {
                console.log('Geolocation available');
                geoFindMe();
            } else {
                alert('Geolocation un-available');
            }
        });

        function geoFindMe() {
            var output = document.getElementById("out");

            $(".bg-info").html("");

            if (!navigator.geolocation) {
                output.innerHTML = "<p>Geolocalização não é suportada no seu browser</p>";
                return;
            }

            function success(position) {
                var latitude = position.coords.latitude;
                var longitude = position.coords.longitude;
                var img = '<img width="100%" src="http://maps.googleapis.com/maps/api/staticmap?markers=color:red%7Clabel:A%7C' + latitude + ',' + longitude + '&center=' + latitude + ',' + longitude + '&zoom=16&size=320x320&sensor=false"/>';

                $('.geoloc').val(latitude + ',' + longitude);
                output.innerHTML += img;
                $(".bg-info").html("");
            };

            function error() {
                $(".bg-info").html("Não foi possível buscar sua localização");
                $(".bg-success").html("");
            };

            $(".bg-info").html("Localizando...");
            $(".bg-success").html("Localizando...");

            navigator.geolocation.getCurrentPosition(success, error);
        }
    </script>
Hello Group,
In just the last few days my users are impacted by an issue when trying to capture their geo coordiantes as part of a Check-in/Check-out process.
So far it's only affecting the Salesforce1 mobile app and as a workaround we're accessing the Salesforce mobile app with Chrome Mobile Browser where everything works fine.
Is anyone else seeing this behavior or have experienced something like this in the past?