-
Notifications
You must be signed in to change notification settings - Fork 128
Support for BasemapGallery toolkit control to include 3D Basemaps #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
7567432
Add 3D Basemap Gallery support in WPF and BasemapGalleryItem
prathameshnarkhede 4c14393
Add 3D basemap support to BasemapGallery in UWP, WinUI and MAUI
prathameshnarkhede bceb6a3
Added condition to check if `GeoModel` is a `Scene` before fetching 3…
prathameshnarkhede dd83807
Renamed `BasemapGallery3DAppearanceSample` to `BasemapGallerySceneVie…
prathameshnarkhede 88b9296
Consolidated Basemap fetching methods
prathameshnarkhede d5298a5
Refactor BasemapGalleryItem to dynamically determine Is3D
prathameshnarkhede ed5edbd
Refactored 3D tag in BasemapGallery to sta on top right corner of the…
prathameshnarkhede ba14de8
Introduce caching for basemaps in BasemapGalleryController
prathameshnarkhede 9de0da1
Update src/Toolkit/Toolkit.WinUI/Esri.ArcGISRuntime.Toolkit.WinUI.csproj
prathameshnarkhede dcaed50
Update bindings to use static lambdas for type safety as new feature …
prathameshnarkhede c194240
Reverted binding style for private set properties
prathameshnarkhede 4358565
Revert Margin in Basemap Gallery Item
prathameshnarkhede e86f2e3
Fixing bug in BasemapGallery loading
prathameshnarkhede 009dc01
Restore styling for basemapgallery
prathameshnarkhede 94dddb4
Refactor basemap loading to be fully asynchronous
prathameshnarkhede b884fe3
Refactor basemap loading and update visibility handling
prathameshnarkhede 9ca2ffd
Update BasemapGallery itemTypeBorder to theme-based color
prathameshnarkhede bffa7aa
Add one-way binding to fix the width sldier in WinUI and UWP and erro…
prathameshnarkhede 0967132
Refactor loading state handling in BasemapGalleryController
prathameshnarkhede 35741ff
Refactor basemap update logic in BasemapGallery
prathameshnarkhede 97dbb3c
Enhance theme management in BasemapGallery
prathameshnarkhede File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
src/Samples/Toolkit.SampleApp.Maui/Samples/BasemapGallerySceneViewAppearanceSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| <?xml version="1.0" encoding="utf-8" ?> | ||
| <ContentPage | ||
| x:Class="Toolkit.SampleApp.Maui.Samples.BasemapGallerySceneViewAppearanceSample" | ||
| xmlns="http://schemas.microsoft.com/dotnet/2021/maui" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" | ||
| xmlns:d="http://xamarin.com/schemas/2014/forms/design" | ||
| xmlns:esri="clr-namespace:Esri.ArcGISRuntime.Maui;assembly=Esri.ArcGISRuntime.Maui" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:toolkit="clr-namespace:Esri.ArcGISRuntime.Toolkit.Maui;assembly=Esri.ArcGISRuntime.Toolkit.Maui" | ||
| Title="3D BasemapGallery - appearance" | ||
| mc:Ignorable="d"> | ||
| <ContentPage.Content> | ||
| <Grid BackgroundColor="{AppThemeBinding Dark=Black, Light=White}"> | ||
| <Grid.RowDefinitions> | ||
| <RowDefinition Height="Auto" /> | ||
| <RowDefinition Height="*" /> | ||
| <RowDefinition Height="200" /> | ||
| </Grid.RowDefinitions> | ||
| <StackLayout Grid.Row="0" Orientation="Horizontal"> | ||
| <Button Clicked="Button_Add_Item" Text="Add special items" /> | ||
| <Button Clicked="Button_Remove_Item" Text="Remove last item" /> | ||
| </StackLayout> | ||
|
|
||
| <esri:SceneView x:Name="MySceneView" Grid.Row="1" /> | ||
|
|
||
| <toolkit:BasemapGallery | ||
| x:Name="Gallery" | ||
| Grid.Row="2" | ||
| GeoModel="{Binding Source={x:Reference MySceneView}, Path=Scene, Mode=OneWay}" /> | ||
| </Grid> | ||
| </ContentPage.Content> | ||
| </ContentPage> |
38 changes: 38 additions & 0 deletions
38
src/Samples/Toolkit.SampleApp.Maui/Samples/BasemapGallerySceneViewAppearanceSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| using Esri.ArcGISRuntime.Mapping; | ||
| using Esri.ArcGISRuntime.Toolkit.Maui; | ||
|
|
||
| namespace Toolkit.SampleApp.Maui.Samples | ||
| { | ||
| [XamlCompilation(XamlCompilationOptions.Compile)] | ||
| [SampleInfo(Category = "BasemapGallery", Description = "Sceneview Basemap Appearance customization sample", ApiKeyRequired = true)] | ||
| public partial class BasemapGallerySceneViewAppearanceSample : ContentPage | ||
| { | ||
| public BasemapGallerySceneViewAppearanceSample() | ||
| { | ||
| InitializeComponent(); | ||
| MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery); | ||
| } | ||
|
|
||
| private async void Button_Add_Item(object? sender, EventArgs e) | ||
| { | ||
| if (Gallery.AvailableBasemaps is null) return; | ||
| BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item.Name = "With Thumbnail"; | ||
| item.Tooltip = Guid.NewGuid().ToString(); | ||
| item.Thumbnail = new Esri.ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg")); | ||
| Gallery.AvailableBasemaps.Add(item); | ||
|
|
||
| BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item2.Name = "Without Thumbnail"; | ||
| Gallery.AvailableBasemaps.Add(item2); | ||
| } | ||
|
|
||
| private void Button_Remove_Item(object? sender, EventArgs e) | ||
| { | ||
| if (Gallery.AvailableBasemaps?.Any() == true) | ||
| { | ||
| Gallery.AvailableBasemaps.RemoveAt(Gallery.AvailableBasemaps.Count - 1); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 57 additions & 0 deletions
57
...Toolkit.SampleApp.UWP/Samples/BasemapGallery/BasemapGallerySceneViewAppearanceSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,57 @@ | ||
| <Page | ||
| x:Class="Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.BasemapGallery.BasemapGallerySceneViewAppearanceSample" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:esri="using:Esri.ArcGISRuntime.UI.Controls" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| xmlns:toolkit="using:Esri.ArcGISRuntime.Toolkit.UI.Controls" | ||
| Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
| mc:Ignorable="d"> | ||
| <Page.Resources> | ||
| <Style TargetType="Button"> | ||
| <Setter Property="HorizontalAlignment" Value="Stretch" /> | ||
| </Style> | ||
| </Page.Resources> | ||
| <Grid> | ||
| <esri:SceneView x:Name="MySceneView" /> | ||
|
|
||
| <Border | ||
| Width="200" | ||
| Margin="8" | ||
| Padding="8" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Top" | ||
| Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"> | ||
| <StackPanel> | ||
| <TextBlock Text="Control Width:" /> | ||
| <Slider | ||
| x:Name="WidthSlider" | ||
| Maximum="1000" | ||
| Minimum="0" | ||
| Value="200" /> | ||
| <TextBlock Text="Gallery View Style: " /> | ||
| <ComboBox | ||
| x:Name="ViewStyleCombobox" | ||
| HorizontalAlignment="Stretch" | ||
| SelectionChanged="ViewStyleCombobox_SelectionChanged" /> | ||
| <Button | ||
| Margin="0,4,0,4" | ||
| Click="Button_Add_Last" | ||
| Content="Add special items" /> | ||
| <Button Click="Button_Remove_Last" Content="Remove last item" /> | ||
| </StackPanel> | ||
| </Border> | ||
|
|
||
| <Border | ||
| Margin="8" | ||
| HorizontalAlignment="Left" | ||
| VerticalAlignment="Bottom" | ||
| Background="White"> | ||
| <toolkit:BasemapGallery | ||
| x:Name="Gallery" | ||
| Width="{x:Bind WidthSlider.Value, Mode=OneWay}" | ||
| GeoModel="{x:Bind MySceneView.Scene, Mode=OneWay}" /> | ||
| </Border> | ||
| </Grid> | ||
| </Page> |
58 changes: 58 additions & 0 deletions
58
...lkit.SampleApp.UWP/Samples/BasemapGallery/BasemapGallerySceneViewAppearanceSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| using Esri.ArcGISRuntime.Mapping; | ||
| using Esri.ArcGISRuntime.Toolkit.UI; | ||
| using System; | ||
| using System.Linq; | ||
|
|
||
| namespace Esri.ArcGISRuntime.Toolkit.SampleApp.Samples.BasemapGallery | ||
| { | ||
| [SampleInfo(ApiKeyRequired = true)] | ||
| public sealed partial class BasemapGallerySceneViewAppearanceSample : Page | ||
| { | ||
| public BasemapGallerySceneViewAppearanceSample() | ||
| { | ||
| InitializeComponent(); | ||
| MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery); | ||
| ViewStyleCombobox.Items.Add("Auto"); | ||
| ViewStyleCombobox.Items.Add("List"); | ||
| ViewStyleCombobox.Items.Add("Grid"); | ||
| ViewStyleCombobox.SelectedIndex = 0; | ||
| } | ||
|
|
||
| private void ViewStyleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
| { | ||
| switch (ViewStyleCombobox.SelectedIndex) | ||
| { | ||
| case 0: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Automatic; | ||
| break; | ||
| case 1: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.List; | ||
| break; | ||
| case 2: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Grid; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| private async void Button_Add_Last(object sender, RoutedEventArgs e) | ||
| { | ||
| BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item.Name = "With Thumbnail"; | ||
| item.Tooltip = Guid.NewGuid().ToString(); | ||
| item.Thumbnail = new ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg")); | ||
| Gallery.AvailableBasemaps.Add(item); | ||
|
|
||
| BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item2.Name = "Without Thumbnail"; | ||
| Gallery.AvailableBasemaps.Add(item2); | ||
| } | ||
|
|
||
| private void Button_Remove_Last(object sender, RoutedEventArgs e) | ||
| { | ||
| if (Gallery.AvailableBasemaps.Any()) | ||
| { | ||
| Gallery.AvailableBasemaps.Remove(Gallery.AvailableBasemaps.Last()); | ||
| } | ||
| } | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
...Toolkit.SampleApp.WPF/Samples/BasemapGallery/BasemapGallerySceneViewAppearanceSample.xaml
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| <UserControl | ||
| x:Class="Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery.BasemapGallerySceneViewAppearanceSample" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:esri="http://schemas.esri.com/arcgis/runtime/2013" | ||
| xmlns:local="clr-namespace:Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| d:DesignHeight="450" | ||
| d:DesignWidth="800" | ||
| mc:Ignorable="d"> | ||
| <Grid> | ||
| <esri:SceneView x:Name="MySceneView" /> | ||
| <Border | ||
| Width="200" | ||
| Margin="8" | ||
| Padding="8" | ||
| HorizontalAlignment="Right" | ||
| VerticalAlignment="Top" | ||
| Background="White"> | ||
| <StackPanel> | ||
| <Label Content="Control Width:" /> | ||
| <Slider | ||
| x:Name="WidthSlider" | ||
| Maximum="1000" | ||
| Minimum="0" | ||
| Value="200" /> | ||
| <Label Content="Gallery View Style: " /> | ||
| <ComboBox x:Name="ViewStyleCombobox" SelectionChanged="ViewStyleCombobox_SelectionChanged" /> | ||
| <Button | ||
| Margin="0,4,0,4" | ||
| Click="Button_Add_Last" | ||
| Content="Add special items" /> | ||
| <Button Click="Button_Remove_Last" Content="Remove last item" /> | ||
| </StackPanel> | ||
| </Border> | ||
|
|
||
| <Border | ||
| Margin="8" | ||
| HorizontalAlignment="Left" | ||
| VerticalAlignment="Bottom" | ||
| Background="White"> | ||
| <esri:BasemapGallery | ||
| x:Name="Gallery" | ||
| Width="{Binding ElementName=WidthSlider, Path=Value}" | ||
| GeoModel="{Binding ElementName=MySceneView, Path=Scene, Mode=OneWay}" /> | ||
| </Border> | ||
| </Grid> | ||
| </UserControl> |
60 changes: 60 additions & 0 deletions
60
...lkit.SampleApp.WPF/Samples/BasemapGallery/BasemapGallerySceneViewAppearanceSample.xaml.cs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| using Esri.ArcGISRuntime.Mapping; | ||
| using Esri.ArcGISRuntime.Toolkit.UI; | ||
| using System; | ||
| using System.Linq; | ||
| using System.Windows; | ||
| using System.Windows.Controls; | ||
|
|
||
| namespace Esri.ArcGISRuntime.Toolkit.Samples.BasemapGallery | ||
| { | ||
| [SampleInfo(Category = "BasemapGallery", DisplayName = "Sceneview BasemapGallery - Appearance", Description = "Sample showing customization options related to appearance for a Sceneview Basemap Gallery", ApiKeyRequired = true)] | ||
| public partial class BasemapGallerySceneViewAppearanceSample : UserControl | ||
| { | ||
| public BasemapGallerySceneViewAppearanceSample() | ||
| { | ||
| InitializeComponent(); | ||
| MySceneView.Scene = new Scene(BasemapStyle.ArcGISImagery); | ||
| ViewStyleCombobox.Items.Add("Auto"); | ||
| ViewStyleCombobox.Items.Add("List"); | ||
| ViewStyleCombobox.Items.Add("Grid"); | ||
| ViewStyleCombobox.SelectedIndex = 0; | ||
| } | ||
|
|
||
| private void ViewStyleCombobox_SelectionChanged(object sender, SelectionChangedEventArgs e) | ||
| { | ||
| switch (ViewStyleCombobox.SelectedIndex) | ||
| { | ||
| case 0: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Automatic; | ||
| break; | ||
| case 1: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.List; | ||
| break; | ||
| case 2: | ||
| Gallery.GalleryViewStyle = BasemapGalleryViewStyle.Grid; | ||
| break; | ||
| } | ||
| } | ||
|
|
||
| private async void Button_Add_Last(object sender, RoutedEventArgs e) | ||
| { | ||
| BasemapGalleryItem item = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item.Name = "With Thumbnail"; | ||
| item.Tooltip = Guid.NewGuid().ToString(); | ||
| item.Thumbnail = new ArcGISRuntime.UI.RuntimeImage(new Uri("https://www.esri.com/content/dam/esrisites/en-us/home/homepage-tile-arcgis-collaboration.jpg")); | ||
| Gallery.AvailableBasemaps.Add(item); | ||
|
|
||
| BasemapGalleryItem item2 = await BasemapGalleryItem.CreateAsync(new Basemap()); | ||
| item2.Name = "Without Thumbnail"; | ||
| Gallery.AvailableBasemaps.Add(item2); | ||
| } | ||
|
|
||
| private void Button_Remove_Last(object sender, RoutedEventArgs e) | ||
| { | ||
| if (Gallery.AvailableBasemaps.Any()) | ||
| { | ||
| Gallery.AvailableBasemaps.Remove(Gallery.AvailableBasemaps.Last()); | ||
| } | ||
| } | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added Mode to One way to fix Width slider in WinUI and UWP.