Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-12065

How to get latitude and longitude with ionic framework in Android

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Do
    • None
    • None
    • Ionic
    • None
    • Android

    Description

      Hi Team

      I am not able to fetch latitude longitude in android using the below code.
      The code is working fine for IOS.

      var options =

      { timeout: 3000, enableHighAccuracy: true }

      ;

      document.addEventListener('deviceready', function () {
      navigator.geolocation.getCurrentPosition(onSuccess, onError, options);
      });

      function onSuccess(position)
      {
      latvalue = position.coords.latitude;
      lngvalue = position.coords.longitude;
      timestamp = position.timestamp;
      alert(latvalue);
      }
      function onError(error)
      {
      alert(error);
      }

      Please suggest what need to be done.

      Attachments

        Activity

          People

            Unassigned Unassigned
            rachita92 Rachita Mathur
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: