movilizer

how to get GeoLocation in Movilizer?


In one of my use case, I need the current address(Geolocation) of my mobile device. How to get current Geolocation in Movilizer.

Anyone knows, Please let me know

Thanks, Krish


Solution

  • Using MEl, first of all you need to activate the continuous GPS capturing, using the method startGPSCapturing(). After it, you can use method getGPSCoordinates() that returns an array with this information:

    {
        timestamp:
        {
            'ac' : accuracy in meters;
            'lt' : latitude;
            'lg' : longitude;
            's'  : source;
        };
    };
    

    This method returns the GPS location data from the queue as a two-dimensional array. The array includes the timestamp, the accuracy in meters, the latitude, the longitude, and the source of the GPS data.