Mouse coordinates format is now multi-map aware#1598
Conversation
Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
|
@copilot Integrate latest changes from master and revalidate your current work |
…ct-layout into copilot/fix-mouse-coordinates-format
Done. Merged the latest master changes (map swipe feature and other fixes) into the branch. All 650 tests pass after the merge. Commit: |
|
@copilot Have post-merge build errors. Pls fix. |
…ired-nullable Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
... Fixed in |
|
@copilot What would be a suitable manual test plan to verify this works? |
Here's a suitable manual test plan: Prerequisites
Test Case 1 — Projected map shows X/Y format
Test Case 2 — Geographic map shows Lon/Lat format
Test Case 3 — Switching between maps updates format
Test Case 4 — Global DisplayProjection takes precedence
Test Case 5 — Single-map appdef is unaffected
|
|
@copilot Manually resolved merge conflicts. Pls revalidate your current work. |
Co-authored-by: jumpinjackie <563860+jumpinjackie@users.noreply.github.com>
Revalidated. The manual merge conflict resolution had dropped the |
|
@copilot What settings do I need to put into my appdef to test this? |
No special appdef settings are required — the coordinate format override is detected and applied automatically at init time. What you need in the appdef: A standard multi-map <MapSet>
<MapGroup id="Map1">
<Map>
<Type>MapGuide</Type>
<Extension>
<ResourceId>Library://Samples/Sheboygan/Maps/Sheboygan.MapDefinition</ResourceId>
<!-- ^ geographic (WGS84/degrees) map -->
</Extension>
</Map>
</MapGroup>
<MapGroup id="Map2">
<Map>
<Type>MapGuide</Type>
<Extension>
<ResourceId>Library://Samples/SomeProjectedMap.MapDefinition</ResourceId>
<!-- ^ projected (meters-based) map -->
</Extension>
</Map>
</MapGroup>
</MapSet>What happens automatically:
To also test the "global projection overrides per-map format" case (Test Case 4): add a |
In multi-map configurations where maps use different coordinate systems (e.g. one geographic/degrees, one projected/meters), the same global format string was applied to all maps — resulting in nonsensical output like
Lon: 1234567, Lat: 9876543 m.Approach
Each map in a multi-map config now carries an optional coordinate format override. When the active map has one set and no global display projection is configured (coordinates are in the map's native CRS), the per-map format is used instead of the global format.
Changes
MapInfo/IBranchedMapSubState— Added optionalcoordinateFormat?: stringfield to carry a per-map format override through init and into Redux state.setupMaps(init-mapguide.ts) — Auto-detects non-geographic maps (via OL projection units check) when no globalDisplayProjectionis configured and assigns a sensible default override"X: {x}, Y: {y} {units}". Geographic maps (degrees) remain unchanged.useActiveMapCoordinateFormathook — New hook inhooks-mapguide.tsthat reads the active map's coordinate format override from state.MouseCoordinatesContainer— Applies the per-map format override when present and no global display projection is active; falls back to global format otherwise:When a global
DisplayProjectionis configured, all maps transform coordinates into that projection's CRS, so the global format remains authoritative.Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
storybook.js.org/opt/hostedtoolcache/node/24.14.0/x64/bin/node /opt/hostedtoolcache/node/24.14.0/x64/bin/node /home/REDACTED/work/mapguide-react-layout/mapguide-react-layout/node_modules/.bin/storybook build -c .storybook(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.