Repository navigation
MapWinGIS6 — Map Model and Basic Navigation - #37
Merged
Merged
Conversation
pmeems
force-pushed
the
phase-3-multi-layer-rendering
branch
from
October 31, 2026 11:52
9e9b90b to
efed8b2
Compare
Base automatically changed from
phase-2-viewport-and-coordinate-transformations
to
development
October 31, 2026 15:44
Add mwg::MapView as the single owner of the map, its viewport, and its render scene, and CreateMapRenderScene to build an owned multi-layer scene with per-layer skip reasons. GDI and OpenGL backends now draw every layer through the same Viewport; GDI skips only layers it cannot draw. The ActiveX control delegates loading, resizing, and redraw decisions to MapView and no longer keeps its own extent or transform. LoadVectorDataset now adds a layer on top of the map. Co-authored-by: Junie <junie@jetbrains.com>
pmeems
force-pushed
the
phase-3-multi-layer-rendering
branch
from
October 31, 2026 15:44
efed8b2 to
0b0c8ff
Compare
Validate loads before changing the view, cache feature totals, expose ClearLayers, and isolate drawing target sizes and layer errors. Add regression tests and update documentation. 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 3 of the Map Model and Basic Navigation plan: multi-layer rendering.
Stacked on #35 (Phase 2, viewport), which is stacked on #34 (Phase 1, map model). Merge those first.
Motivation
Before this change the control kept one dataset, one render scene, and its own extent-fitting
ViewTransform. Two layers could not be shown together, and the view state lived in ActiveX instead of in Core.What changes
mwg::MapView(Core). It owns theMap, the oneViewportthat all layers are drawn through, and the render scene. It is now the only map and view state: the control has no extent or transform of its own.rendering::CreateMapRenderScene(Core). It builds an owned snapshot of all visible layers, bottom layer first. Each layer is converted separately. Hidden layers, empty layers, and layers that fail (for example, non-polygon layers) are listed inskippedLayersand do not block the others.Viewport.ViewTransformis now just a per-frame copy of the viewport, using the same arithmetic asViewport::MapToScreen. GDI checks each layer before drawing it, skips a layer it cannot draw, and reports it throughGetFailedLayersandRenderingStatus. OpenGL still renders the whole frame or falls back to GDI.MapView, which marks the scene stale. Each mutator returns whether the frame changed, and the control callsFireViewChangeonly when it did. A resize keeps the center and resolution and does not rebuild the scene.WM_SIZE, and also the drawn bounds, because windowless hosts never sendWM_SIZE. Sizes are clamped toViewport::kMaxDimension. A fit requested before the control has a size, or while it is minimized, happens on the first resize that gives it a size.LoadVectorDatasetnow adds the dataset's first layer on top of the map instead of replacing what is loaded.FeatureCountis the total over all layers. Until navigation is exposed (Phase 5), every load fits the view to the whole map. Non-polygon layers are still rejected at load time.Design decisions
MapViewlives in Core rather than in the control, so the Phase 4 navigation code can build on one tested owner of the map and viewport (plan decisions 1 and 4).Testing
MapRenderSceneTests,MapViewTests, and multi-layer GDI/OpenGL pixel tests.Remaining limitations are listed in the plan under Phase 3. The main ones: there are no COM methods to remove or hide layers yet, the scene is rebuilt for all layers on any map change, and there is no clipping, so GDI skips a layer whose device coordinates go out of range at deep zoom.