a
    {bK
                     @   s   d Z G dd dZdS )a  
GPS
====

.. versionadded:: 1.1

.. note::
    On Android `INTERNET`, `ACCESS_FINE_LOCATION`, `ACCESS_COARSE_LOCATION`
    permissions are needed.


.. note::
    On iOS `NSLocationWhenInUseUsageDescription` key is required for app to
    display geolocation usage permission prompt. Key can be added in Xcode
    target `info` section or in ``Resources/<YourApp>-info.plist``.
    App background mode (`on_pause`) also must be supported.

You need to set a `on_location` callback with the :meth:`configure` method.
This callback will receive a couple of keywords / values, that might be
different depending of their availability on the targeted platform.
Lat and lon are always available.

- lat: latitude of the last location, in degrees
- lon: longitude of the last location, in degrees
- speed: speed of the user, in meters/second over ground
- bearing: bearing in degrees
- altitude: altitude in meters above the sea level

Here is an example of the usage of gps::

    from plyer import gps

    def print_locations(**kwargs):
        print 'lat: {lat}, lon: {lon}'.format(**kwargs)

    gps.configure(on_location=print_locations)
    gps.start()
    # later
    gps.stop()

Supported Platforms
-------------------
Android, iOS

c                   @   sD   e Zd ZdZdddZdddZd	d
 Zdd Zdd Zdd Z	dS )GPSz
    GPS facade.
    Nc                 C   s   || _ || _|   dS )a?  
        Configure the GPS object. This method should be called before
        :meth:`start`.

        :param on_location: Function to call when receiving a new location
        :param on_status: Function to call when a status message is received
        :type on_location: callable, multiples keys/value will be passed.
        :type on_status: callable, args are "message-type", "status"

        .. warning::

            The `on_location` and `on_status` callables might be called from
            another thread than the thread used for creating the GPS object.
        N)on_location	on_status
_configure)selfr   r    r   a/Users/vegardjervell/Documents/master/model/venv/lib/python3.9/site-packages/plyer/facades/gps.py	configure5   s    zGPS.configure     c                 C   s   | j ||d dS )z
        Start the GPS location updates.
        Expects 2 parameters:
            minTime: milliseconds.  (float)
            minDistance: meters. (float)
        )minTimeminDistanceN)_start)r   r   r   r   r   r   startH   s    z	GPS.startc                 C   s   |    dS )z0
        Stop the GPS location updates.
        N)_stopr   r   r   r   stopQ   s    zGPS.stopc                 C   s
   t  d S NNotImplementedErrorr   r   r   r   r   Y   s    zGPS._configurec                 K   s
   t  d S r   r   )r   kwargsr   r   r   r   \   s    z
GPS._startc                 C   s
   t  d S r   r   r   r   r   r   r   _   s    z	GPS._stop)N)r	   r
   )
__name__
__module____qualname____doc__r   r   r   r   r   r   r   r   r   r   r   0   s   

	r   N)r   r   r   r   r   r   <module>   s   /