Ejemplo n.º 1
0
        /// <summary>
        /// This is the event handler for StatusChanged events.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //async private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs e)
        //{
        //    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
        //    {
        //        switch (e.Status)
        //        {
        //            case PositionStatus.Ready:
        //                // Location platform is providing valid data.
        //                //ScenarioOutput_Status.Text = "Ready";
        //                break;

        //            case PositionStatus.Initializing:
        //                // Location platform is acquiring a fix. It may or may not have data. Or the data may be less accurate.
        //                //ScenarioOutput_Status.Text = "Initializing";
        //                break;

        //            case PositionStatus.NoData:
        //                // Location platform could not obtain location data.
        //                //ScenarioOutput_Status.Text = "No data";
        //                break;

        //            case PositionStatus.Disabled:
        //                // The permission to access location data is denied by the user or other policies.
        //                //ScenarioOutput_Status.Text = "Disabled";

        //                //Clear cached location data if any
        //                //ScenarioOutput_Latitude.Text = "No data";
        //                //ScenarioOutput_Longitude.Text = "No data";
        //                //ScenarioOutput_Accuracy.Text = "No data";
        //                break;

        //            case PositionStatus.NotInitialized:
        //                // The location platform is not initialized. This indicates that the application has not made a request for location data.
        //                //ScenarioOutput_Status.Text = "Not initialized";
        //                break;

        //            case PositionStatus.NotAvailable:
        //                // The location platform is not available on this version of the OS.
        //                //ScenarioOutput_Status.Text = "Not available";
        //                break;

        //            default:
        //                //ScenarioOutput_Status.Text = "Unknown";
        //                break;
        //        }
        //    });
        //}

        //Add a pushpin with a label to the map
        private void AddPushpinToMap(double latitude, double longitude, OBJ_Establishment oEst)
        {
            Location location = new Location(latitude, longitude);
            Pushpin  pushpin  = new Pushpin();

            pushpin.Text    = oEst.estName;
            pushpin.Tag     = oEst;
            pushpin.Tapped += new TappedEventHandler(pushpinTapped);//Add onclick pushpin event
            MapLayer.SetPosition(pushpin, new Location(location));
            map.Children.Add(pushpin);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Show popup messages
 /// </summary>
 private async void pushpinTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
 {
     Pushpin           pushpin = (Pushpin)sender;
     OBJ_Establishment oEst    = (OBJ_Establishment)pushpin.Tag;
     MessageDialog     dialog  = new MessageDialog("Comercio: " + oEst.estName + "\n" +
                                                   "Email: " + oEst.estEmail + "\n" +
                                                   "Estatus: " + oEst.estStatus + "\n" +
                                                   "Dirección: " + oEst.estAddPhysical1 + "\n" +
                                                   "                 " + oEst.estAddPhysical2 + "\n" +
                                                   "                 " + oEst.estAddPhysicalCity + ", " + oEst.estAddPhysicalState + ", " + oEst.estAddPhysicalZipCode + "\n"
                                                   );
     await dialog.ShowAsync();
 }
Ejemplo n.º 3
0
        /// <summary>
        /// This is the event handler for StatusChanged events.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        //async private void OnStatusChanged(Geolocator sender, StatusChangedEventArgs e)
        //{
        //    await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
        //    {
        //        switch (e.Status)
        //        {
        //            case PositionStatus.Ready:
        //                // Location platform is providing valid data.
        //                //ScenarioOutput_Status.Text = "Ready";
        //                break;

        //            case PositionStatus.Initializing:
        //                // Location platform is acquiring a fix. It may or may not have data. Or the data may be less accurate.
        //                //ScenarioOutput_Status.Text = "Initializing";
        //                break;

        //            case PositionStatus.NoData:
        //                // Location platform could not obtain location data.
        //                //ScenarioOutput_Status.Text = "No data";
        //                break;

        //            case PositionStatus.Disabled:
        //                // The permission to access location data is denied by the user or other policies.
        //                //ScenarioOutput_Status.Text = "Disabled";

        //                //Clear cached location data if any
        //                //ScenarioOutput_Latitude.Text = "No data";
        //                //ScenarioOutput_Longitude.Text = "No data";
        //                //ScenarioOutput_Accuracy.Text = "No data";
        //                break;

        //            case PositionStatus.NotInitialized:
        //                // The location platform is not initialized. This indicates that the application has not made a request for location data.
        //                //ScenarioOutput_Status.Text = "Not initialized";
        //                break;

        //            case PositionStatus.NotAvailable:
        //                // The location platform is not available on this version of the OS.
        //                //ScenarioOutput_Status.Text = "Not available";
        //                break;

        //            default:
        //                //ScenarioOutput_Status.Text = "Unknown";
        //                break;
        //        }
        //    });
        //}

        //Add a pushpin with a label to the map
        private void AddPushpinToMap(double latitude, double longitude, OBJ_Establishment oEst)
        {
            Location location = new Location(latitude, longitude);
            Pushpin pushpin = new Pushpin();
            pushpin.Text = oEst.estName;
            pushpin.Tag = oEst;
            pushpin.Tapped += new TappedEventHandler(pushpinTapped);//Add onclick pushpin event
            MapLayer.SetPosition(pushpin, new Location(location));
            map.Children.Add(pushpin);
        }