diff --git a/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.Appearance.cs b/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.Appearance.cs
index db4f84d3a..9f852809c 100644
--- a/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.Appearance.cs
+++ b/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.Appearance.cs
@@ -173,7 +173,7 @@ static BasemapGallery()
-
+
diff --git a/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs b/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs
index b21c1eeca..626d59ca4 100644
--- a/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs
+++ b/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs
@@ -46,21 +46,10 @@ public BasemapGallery()
private void BasemapGallery_Loaded(object? sender, EventArgs e)
{
- LoadBasemaps();
- }
-
- private void LoadBasemaps()
- {
- _controller.IsLoading = true;
- if (AvailableBasemaps == null)
+ if (AvailableBasemaps is null)
{
_ = _controller.LoadFromDefaultPortal();
}
- else
- {
- _controller.AvailableBasemaps = AvailableBasemaps;
- }
- _controller.IsLoading = false;
}
private void HandleControllerPropertyChanged(object? sender, PropertyChangedEventArgs e)
diff --git a/src/Toolkit/Toolkit.UI.Controls/BasemapGallery/BasemapGallery.Windows.cs b/src/Toolkit/Toolkit.UI.Controls/BasemapGallery/BasemapGallery.Windows.cs
index 24a2e6808..2240b933c 100644
--- a/src/Toolkit/Toolkit.UI.Controls/BasemapGallery/BasemapGallery.Windows.cs
+++ b/src/Toolkit/Toolkit.UI.Controls/BasemapGallery/BasemapGallery.Windows.cs
@@ -50,21 +50,10 @@ public BasemapGallery()
private void BasemapGallery_Loaded(object? sender, RoutedEventArgs e)
{
- LoadBasemaps();
- }
-
- private void LoadBasemaps()
- {
- _controller.IsLoading = true;
- if (AvailableBasemaps == null)
+ if (AvailableBasemaps is null)
{
_ = _controller.LoadFromDefaultPortal();
}
- else
- {
- _controller.AvailableBasemaps = AvailableBasemaps;
- }
- _controller.IsLoading = false;
}
private void HandleControllerPropertyChanged(object? sender, PropertyChangedEventArgs e)
diff --git a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs
index f95807278..a2f7f797c 100644
--- a/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs
+++ b/src/Toolkit/Toolkit/UI/Controls/BasemapGallery/BasemapGalleryItem.cs
@@ -246,7 +246,8 @@ internal bool EqualsBasemap(Basemap? other)
return false;
}
- return other == Basemap || other.Name == Basemap?.Name
+ return other == Basemap || (Basemap.BaseLayers.Count == other.BaseLayers.Count
+ && Basemap.BaseLayers.All(layer => other?.BaseLayers.FirstOrDefault(l => l.Name == layer.Name) is not null))
|| (other.Item?.ItemId != null && other.Item?.ItemId == Basemap?.Item?.ItemId)
|| (other.Uri != null && other.Uri == Basemap?.Uri);
}