-
Notifications
You must be signed in to change notification settings - Fork 121
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
BasemapGallery loading demo data in production release #566
Comments
Could you clarify what you mean by that? Any chance you could provide a small reproducer that demonstrates the issue? |
I can see I was a bit short in my description. I'll explain myself more clearly. If I add this xaml <toolkit:BasemapGallery /> then I get a list of maps I would expect to get an empty basemap gallery, I expect to get nothing at all. That is what I think of as "demo basemaps". For me it is a bit unusual that a UI control loads default data. Then I try this expecting to stop loading the "demo basemaps" <toolkit:BasemapGallery Portal="{x:Null}" /> But it still continues loading. Next up is <toolkit:BasemapGallery Portal="{x:Null}"
AvailableBasemaps="{Binding Basemaps}" /> public MapPageViewModel()
{
LoadBasemapGallery();
}
private async void LoadBasemapGallery()
{
var aTask = BasemapGalleryItem.CreateAsync(new Basemap(new ArcGISTiledLayer(new Uri(Constants.GeodataServiceUri.Bilder))));
var bTask = BasemapGalleryItem.CreateAsync(new Basemap(new ArcGISTiledLayer(new Uri(Constants.GeodataServiceUri.VectorNordenBasisTerreng))));
var cTask = BasemapGalleryItem.CreateAsync(new Basemap(new ArcGISTiledLayer(new Uri(Constants.GeodataServiceUri.VectorNordenGråtoneTerreng))));
await Task.WhenAll(aTask, bTask, cTask);
Basemaps.Add(aTask.Result);
Basemaps.Add(bTask.Result);
Basemaps.Add(cTask.Result);
}
public ObservableCollection<BasemapGalleryItem> Basemaps { get; } = new(); But it still continues to load the "demo basemaps" and I can't get it to show my custom basemaps definition. At this point I looked up the source code arcgis-maps-sdk-dotnet-toolkit/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs Lines 37 to 45 in 5a3260c
..and discovered that the loading of initial "demo basemaps" are triggered from the constructor regardless of anything else. For apps that don't use this initial setup of basemaps I think that is a bit unfortunate. It also leads to many |
Hi, I have a hard time initializing
BasemapGallery.AvailableBasemaps
with a custom list of basemaps. The shown gallery is overridden by the loading of what seems to be demo data. Except for a sample app, why would one want this behavior?PS: Not using a portal
arcgis-maps-sdk-dotnet-toolkit/src/Toolkit/Toolkit.Maui/BasemapGallery/BasemapGallery.cs
Lines 37 to 45 in 5a3260c
The text was updated successfully, but these errors were encountered: