示例#1
0
        private async void button_Click(object sender, RoutedEventArgs e)
        {
            if (MapControl1.IsStreetsideSupported)
            {
                BasicGeoposition cityPosition = new BasicGeoposition()
                {
                    Latitude = 48.858, Longitude = 2.295
                };
                Geopoint           cityCenter       = new Geopoint(cityPosition);
                StreetsidePanorama panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(cityCenter);


                if (panoramaNearCity != null)
                {
                    StreetsideExperience ssView = new StreetsideExperience(panoramaNearCity);
                    ssView.OverviewMapVisible    = true;
                    MapControl1.CustomExperience = ssView;
                }
            }
            else
            {
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "Streetside is not supported",
                    Content           = "\nStreetside views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
示例#2
0
        private async void ShowStreetsideView()
        {
            // Check if Streetside is supported.
            if (Map.IsStreetsideSupported)
            {
                // Find a panorama near Avenue Gustave Eiffel.
                BasicGeoposition cityPosition = new BasicGeoposition()
                {
                    Latitude = 48.858, Longitude = 2.295
                };
                Geopoint           cityCenter       = new Geopoint(cityPosition);
                StreetsidePanorama panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(cityCenter);

                // Set the Streetside view if a panorama exists.
                if (panoramaNearCity != null)
                {
                    // Create the Streetside view.
                    StreetsideExperience ssView = new StreetsideExperience(panoramaNearCity);
                    ssView.OverviewMapVisible = true;
                    Map.CustomExperience      = ssView;
                }
            }
            else
            {
                // If Streetside is not supported
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "Streetside is not supported",
                    Content           = "\nStreetside views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
        async public Task InitializeAsync(Geopoint center)
        {
            Center = center;
            streetview_map.Center = Center;
            if (streetview_map.IsStreetsideSupported)
            {
                var street_panorama = await StreetsidePanorama.FindNearbyAsync(streetview_map.Center);

                var street_exp = new StreetsideExperience(street_panorama);
                street_exp.OverviewMapVisible   = true;
                streetview_map.CustomExperience = street_exp;
            }
            else
            {
                NotSupported?.Invoke();
            }
            _core_appview.TitleBar.ExtendViewIntoTitleBar = true;


            //size the window
            _appview.SetPreferredMinSize(new Size(500, 400));

            //set background
            _appview.TitleBar.ButtonBackgroundColor         = Colors.Transparent;
            _appview.TitleBar.ButtonForegroundColor         = Colors.White;
            _appview.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
            _appview.TitleBar.ButtonInactiveForegroundColor = Colors.White;

            rect_titlebar.Fill = new SolidColorBrush(TitlebarColor);
            Window.Current.SetTitleBar(rect_titlebar);
        }
        //Función para visualizar el StreetView
        private async void click_StretView(object sender, RoutedEventArgs e)
        {
            // Comprobación de si el dispositivo soporta Streetside
            if (MapControl.IsStreetsideSupported)
            {
                StreetsidePanorama panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(miPosiciónActual);

                // Si el panorama existe, se crea el StreetView y se establece en el mapa para ser visualizado
                if (panoramaNearCity != null)
                {
                    StreetsideExperience stretView = new StreetsideExperience(panoramaNearCity);
                    stretView.OverviewMapVisible = true;
                    MapControl.CustomExperience  = stretView;
                }
            }
            else
            {
                // Si el dispositivo no soporta Streetside, aparece el siguiente mensaje de dialogo
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "StretView no soportado",
                    Content           = "La vista StretView no es soportada en tu dispositvo.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
示例#5
0
        async private void OnShowStreetView(object sender, RoutedEventArgs e)
        {
            if (map.IsStreetsideSupported)
            {
                var street_panorama = await StreetsidePanorama.FindNearbyAsync(map.Center);

                StreetsideExperience street_exp = new StreetsideExperience(street_panorama);
                map.CustomExperience = street_exp;
            }
        }
示例#6
0
        private async void button1_Click(object sender, RoutedEventArgs e)
        {
            //await  map1.TrySetSceneAsync(MapScene.CreateFromLocationAndRadius(myloc, 5,90,60));
            try
            {
                StreetsidePanorama panorama = await StreetsidePanorama.FindNearbyAsync((await MapLocationFinder.FindLocationsAsync("Vancouver Downtown, BC", null)).Locations[0].Point);

                map1.CustomExperience = new StreetsideExperience(panorama);
            }
            catch (Exception ex)
            {
                var m1 = new MessageDialog("" + ex).ShowAsync();
            }
        }
示例#7
0
        public async void ShowStreet(object sender, RoutedEventArgs e)
        {
            Flyout?.Hide();
            // sender is the button - and the data context is the Sight
            CurrentSight = ((Button)sender).DataContext as Sight;
            if (CurrentSight == null)
            {
                return;
            }

            // Check if Streetside is supported.
            if (Map.IsStreetsideSupported)
            {
                var panorama = await StreetsidePanorama.FindNearbyAsync(CurrentSight.Location);

                // Set the Streetside view if a panorama exists.
                if (panorama != null)
                {
                    // Create the Streetside view.
                    var ssView = new StreetsideExperience(panorama)
                    {
                        OverviewMapVisible = true
                    };
                    Map.CustomExperience = ssView;
                }
                else
                {
                    var viewNotSupportedDialog = new ContentDialog
                    {
                        Title             = "Streetside not available",
                        Content           = "\nNo Streetside view found for this location.",
                        PrimaryButtonText = "OK"
                    };
                    await viewNotSupportedDialog.ShowAsync();
                }
            }
            else
            {
                // If Streetside is not supported
                var viewNotSupportedDialog = new ContentDialog
                {
                    Title             = "Streetside is not supported",
                    Content           = "\nStreetside views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
示例#8
0
        public async void StartStreetViewAsync()
        {
            if (_mapControl.IsStreetsideSupported)
            {
                var panorama = await StreetsidePanorama.FindNearbyAsync(CurrentPosition);

                if (panorama == null)
                {
                    var dlg = new MessageDialog("No streetside available here");
                    await dlg.ShowAsync();

                    return;
                }
                IsStreetView = true;
                _mapControl.CustomExperience = new StreetsideExperience(panorama);
            }
        }
示例#9
0
        private async void ShowStreetsideView()
        {
            // Check if Streetside is supported
            if (map.IsStreetsideSupported)
            {
                // Find panorama near
                //var storePosition = new Geopoint(new BasicGeoposition
                //{
                //    Latitude = App.ViewModel.SelectedStore.store.coordinates.latitude,
                //    Longitude = App.ViewModel.SelectedStore.store.coordinates.longitude
                //});

                var storePosition = new Geopoint(new BasicGeoposition
                {
                    Latitude  = App.ViewModel.SelectedStore.Coordinates.Latitude,
                    Longitude = App.ViewModel.SelectedStore.Coordinates.Longitude
                });

                var panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(storePosition);

                // Set Streetside view if panorama exists
                if (panoramaNearCity != null)
                {
                    // Create Streetside view
                    StreetsideExperience ssView = new StreetsideExperience(panoramaNearCity);
                    ssView.OverviewMapVisible = true;
                    map.CustomExperience      = ssView;
                }
            }
            else
            {
                // If Streetside is not supported
                ContentDialog viewNotSupportedDialog = new ContentDialog()
                {
                    Title             = "Streetside is not supported",
                    Content           = "\nStreetside views are not supported on this device.",
                    PrimaryButtonText = "OK"
                };
                await viewNotSupportedDialog.ShowAsync();
            }
        }
示例#10
0
        private async void loadStreetsidePanorama(Geopoint location)
        {
            StreetsidePanorama movieLocationPanorama = await StreetsidePanorama.FindNearbyAsync(location);

            if (movieLocationPanorama == null)
            {
                streetSideMap.Visibility = Visibility.Collapsed;
                return;
            }

            streetSideMap.Visibility = Visibility.Visible;

            StreetsideExperience movieLocationStreetside = new StreetsideExperience(movieLocationPanorama)
            {
                ExitButtonVisible  = false,
                ZoomButtonsVisible = false,
                OverviewMapVisible = false,
            };

            streetSideMap.CustomExperience = movieLocationStreetside;
        }
        private async void showStreetSideNearSpaceneedle_Click(object sender, RoutedEventArgs e)
        {
            if (myMap.IsStreetsideSupported)
            {
                BasicGeoposition spaceNeedlePosition = new BasicGeoposition();
                spaceNeedlePosition.Latitude  = 47.6204;
                spaceNeedlePosition.Longitude = -122.3491;

                Geopoint spaceNeedlePoint = new Geopoint(spaceNeedlePosition);

                StreetsidePanorama panoramaNearSpaceNeedle = await StreetsidePanorama.FindNearbyAsync(spaceNeedlePoint);

                if (panoramaNearSpaceNeedle != null)
                {
                    myMap.CustomExperience = new StreetsideExperience(panoramaNearSpaceNeedle);
                }
            }
            else
            {
                string status = "Streetside views are not supported on this device.";
                rootPage.NotifyUser(status, NotifyType.ErrorMessage);
            }
        }