Skip to content

Basemap gallery toolkit component#108

Open
martinoyovo wants to merge 42 commits intov.nextfrom
martinoyovo/basemap_gallery_toolkit_component
Open

Basemap gallery toolkit component#108
martinoyovo wants to merge 42 commits intov.nextfrom
martinoyovo/basemap_gallery_toolkit_component

Conversation

@martinoyovo
Copy link
Copy Markdown
Collaborator

The BasemapGallery is a UI component that lets a user browse a collection of basemaps and apply a selection to a connected GeoModel via a BasemapGalleryController.

The basemaps shown in the gallery are provided by the controller (defaults, a portal, or custom items), and the current selection is tracked by the controller.

Features

  • Displays basemaps as a grid, list, or automatically switches based on available width.
  • Shows selection state and exposes selection events via the controller.

Usage

Provide a BasemapGalleryController and place the gallery in your widget tree.

late final ArcGISMap _map;
late final BasemapGalleryController _controller;

@override
void initState() {
  super.initState();
  _map = ArcGISMap.withBasemapStyle(BasemapStyle.arcGISTopographic);
  _controller = BasemapGalleryController(geoModel: _map);
}

@override
Widget build(BuildContext context) {
  return BasemapGallery(controller: _controller);
}
Simulator.Screen.Recording.-.iPhone.17.Pro.Max.-.2025-12-31.at.13.12.19.mov

@martinoyovo martinoyovo self-assigned this Dec 31, 2025
Comment thread example/lib/example_basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart
Comment thread lib/src/basemap_gallery/basemap_gallery_item.dart
Comment thread lib/src/basemap_gallery/models/basemap_gallery_item.dart Outdated
if (referenceSpatialReference == null) {
_spatialReferenceStatus =
BasemapGalleryItemSpatialReferenceStatus.unknown;
} else if (_spatialReference == referenceSpatialReference) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be

(_spatialReference.wkid == referenceSpatialReference.wkid) 

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’re trying to detect a spatial reference mismatch; comparing only the WKID can miss mismatches for others.

Comment thread lib/src/basemap_gallery/utils/image_loadable.dart Outdated
Comment thread lib/src/basemap_gallery/controllers/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/controllers/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/controllers/basemap_gallery_controller.dart Outdated
@changanxian
Copy link
Copy Markdown
Collaborator

It is nice to have different folders to classify the MVC classes. Since each folder only has one class, and the class name has been self-identified, we could move the classes under one folder and focus on the public API, hiding the internal implementation in a different folder.

Comment thread lib/src/basemap_gallery/models/basemap_gallery_item.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread example/lib/example_basemap_gallery.dart Outdated
Comment thread example/lib/example_basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/controllers/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/controllers/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery_controller.dart
@martinoyovo
Copy link
Copy Markdown
Collaborator Author

Thank you again for all your feedback! I’ve incorporated the changes into the repo, and the branch has been updated. Please take a look when you have a chance, and let me know if there’s anything else I can improve. I’m always open to suggestions. Thanks!

Comment thread CHANGELOG.md Outdated
Comment thread lib/src/overview_map/overview_map.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery_controller.dart
Copy link
Copy Markdown
Collaborator

@PaulAllanSturm PaulAllanSturm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added a few more comments

Copy link
Copy Markdown
Collaborator

@jenmerritt jenmerritt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've built the API ref and done a re-review of the public API and design - have a few more queries below. Overall it's feeling a lot closer to design though.

I plan to do some user testing and throw some data at it on Monday 👀

Comment thread lib/src/basemap_gallery/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery_controller.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery_item.dart Outdated
Comment thread lib/src/basemap_gallery/basemap_gallery_item.dart Outdated
Copy link
Copy Markdown
Collaborator

@jenmerritt jenmerritt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has come along way @martinoyovo , nice work. To the point where I've really hammered it in user quality testing today. I think some of these should be written up as individual tasks, but take the time to read through and maybe we can sync up on them to go through. Perhaps you can also experiment with some of the things I've been testing.

Comment thread lib/src/basemap_gallery/basemap_gallery_controller.dart
Comment thread lib/src/basemap_gallery/basemap_gallery.dart
Comment thread example/lib/example_basemap_gallery.dart
Comment thread lib/src/basemap_gallery/basemap_gallery.dart
Comment thread lib/src/basemap_gallery/basemap_gallery.dart
@martinoyovo martinoyovo force-pushed the martinoyovo/basemap_gallery_toolkit_component branch 3 times, most recently from 32212e3 to f7f6f42 Compare April 17, 2026 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants