Exemple #1
0
        private async void InitGPS()
        {
            mapController.GeofenceEnteredEventTriggered += MapController_GeofenceEnteredEventTriggered;
            mapController.GeofenceExitedEventTriggered  += MapController_GeofenceExitedEventTriggered;
            bool succesfullConnect = await gpsHandler.RequestUserAccesAsync();

            if (succesfullConnect)
            {
                //Init gpshandler with movement threshold
                gpsHandler.InitGPSHandler(1);

                //Subscribe method for continuous location changes
                gpsHandler.SubscribeToLocation(GpsHandler_positionChangedEvent);
            }
        }
        private async void page_Loaded(object sender, RoutedEventArgs args)
        {
            //Init GPS
            bool succesfullConnect = await gpsHandler.RequestUserAccesAsync();

            if (succesfullConnect)
            {
                //Init gpshandler with movement threshold
                gpsHandler.InitGPSHandler(1);

                //Subscribe method for continuous location changes
                gpsHandler.SubscribeToLocation(GpsHandler_positionChangedEvent);
            }
            //await Task.Delay(TimeSpan.FromSeconds(1));
            await loading();
        }