Repository navigation
MapWinGIS6 — Map Model and Basic Navigation - #34
Merged
Merged
Conversation
Introduce mwg::Map and mwg::MapLayer: an ordered layer collection with stable LayerId identities, visibility, shared dataset ownership, and a combined extent of valid layer extents. Add Extent::IsValid, a MakeRectanglesDataset test fixture, map tests, and architecture docs. Co-authored-by: Junie <junie@jetbrains.com>
Julian-MW
reviewed
Oct 31, 2026
Julian-MW
left a comment
There was a problem hiding this comment.
Source review complete. I left two inline comments: one for the LayerId overflow edge case and one for missing coverage of a successful non-zero source-layer index.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Phase 1 of the Map Model and Basic Navigation plan.
Motivation
Core had no notion of a map. ActiveX holds one dataset and its extent directly. Later phases (viewport, multi-layer rendering, navigation, drag-and-drop) need one authoritative Core model that owns the layers and their combined extent.
What changes
mwg::Map/mwg::MapLayer(mapwingis/map/Map.h): an ordered layer collection with add, remove by identity, clear, count, position lookup, find, and visibility.Map::GetExtent(ExtentScope): the union of valid layer extents.VisibleLayers(the default, used for zoom-to-map) excludes hidden layers;AllLayersincludes them.Extent::IsValid(): non-empty with all bounds finite.MakeRectanglesDatasetandMapTests.cpp(20 tests). No window and no ActiveX.docs/ARCHITECTURE.mdgets a "Map model" section on identity, ordering, ownership, duplicates, visibility, extents, and coordinates.Key design decisions
LayerIdis a monotonically increasing value that is never reused, not even afterClear. Positions shift; identities don't.AddLayerappends on top.MapLayerholds ashared_ptr<VectorDataset>, so the source layer outlives the caller's handle. Layers are stored asunique_ptr, so removing one layer never invalidates references to the others.VectorLayeralready caches its own extent.Dependencies / follow-up
development. Later phases stack on this branch.Mapyet; that is Phase 3.Build: Debug|x64, 0 warnings. Tests: 190 passed, 3 skipped (opt-in suites).