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(); } }
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(); } }
private async void Panorama_Click(object sender, RoutedEventArgs e) { BasicGeoposition cityPosition = new BasicGeoposition() { Latitude = 48.858, Longitude = 2.295 }; Geopoint cityCenter = new Geopoint(cityPosition); StreetsidePanorama panoramaNearCity = await StreetsidePanorama.FindNearbyAsync(cityCenter); StreetsideExperience ssView = new StreetsideExperience(panoramaNearCity); ssView.OverviewMapVisible = true; MapControl1.CustomExperience = ssView; }
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; } }
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(); } }
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(); } }
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 showStreetsideView() { // Check if Streetside is supported. if (MapControl1.IsStreetsideSupported) { // Find a panorama near Avenue Gustave Eiffel. BasicGeoposition cityPosition = new BasicGeoposition() { Latitude = 48.869465, Longitude = 2.394892 }; 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; MapControl1.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(); } }