Skip to content

Conversation

@subashtiwari1010
Copy link
Contributor

@subashtiwari1010 subashtiwari1010 commented Dec 10, 2025

Description

This PR updates the layout of the map viewer with the possibility of adding the map as the background and letting all the components act as the overlay over the map. The feature grid is added in the bottom container of the map layout.

Please check if the PR fulfills these requirements

What kind of change does this PR introduce? (check one with "x", remove the others)

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Other... Please describe:

Issue

What is the current behavior?
The feature grid is in the dock container of the map viewer.
#11794

What is the new behavior?
The feature grid is displayed in the bottom container of the map layout.

Breaking change

Does this PR introduce a breaking change? (check one with "x", remove the other)

  • Yes, and I documented them in migration notes
  • No

Copy link
Contributor

@allyoucanmap allyoucanmap left a comment

Choose a reason for hiding this comment

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

In addition to the inline comments:

import React from "react";
import FlexBox, { FlexFill } from "./FlexBox";

export default ({
Copy link
Contributor

Choose a reason for hiding this comment

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

please avoid direct default export, write instead

const MapViewerLayout = () => ({
...

export default MapViewerLayout;

Comment on lines +19 to +35
<FlexBox id={id} className={className} column classNames={['_fill', '_absolute']}>
{header}
<FlexFill flexBox column className={bodyClassName} classNames={['_relative', 'ms2-layout-body']}>
<div className="_fill _absolute">{background}</div>
<div className="_relative">{top}</div>
<FlexFill flexBox classNames={['_relative', 'ms2-layout-main-content']}>
<div className="_relative ms2-layout-left-column">{leftColumn}</div>
<FlexFill classNames={['_relative', 'ms2-layout-content']}>
{children}
</FlexFill>
<div className="_relative ms2-layout-right-column">{rightColumn}</div>
<div className="ms2-layout-columns">{columns}</div>
</FlexFill>
<div className="_relative">{bottom}</div>
</FlexFill>
{footer}
</FlexBox>
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's change name of the classes to ensure it is not the same of BorderLayout. We could use ms-map-viewer-layout, ms-map-viewer-layout-...

Comment on lines +158 to +167
/* Disable pointer events on the main content container but enable them for all its children */
.ms2-layout-main-content {
pointer-events: none;
}
.ms2-layout-main-content .ms2-layout-content > *,
.ms2-layout-main-content .ms2-layout-left-column > *,
.ms2-layout-main-content .ms2-layout-right-column > *,
.ms2-layout-main-content .ms2-layout-columns > * {
pointer-events: auto;
}
Copy link
Contributor

Choose a reason for hiding this comment

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

review classes based on previous comment. In addition we should ensure these classes are included in the main theme, the viewer.css may be included in component not used inside other project, I think we should move this inside the .less files, maybe in common.less

newFeatures: [],
features: [],
dockSize: 0.35,
dockSize: 0,
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to review how dockSize has been used and in case remove completely the logic from MapStore including related actions. Could you check if we had previously logic to set the initial size of the Attribute table panel?

We need also to clean up all the logic related to the feature editor dock bottom size in updateMapLayoutEpic, it's not needed anymore

Comment on lines +86 to +105
style={{
height: '4px',
cursor: 'row-resize',
backgroundColor: 'transparent',
position: 'absolute',
top: 0,
left: 0,
right: 0,
zIndex: 10,
borderTop: '2px solid transparent',
transition: 'border-color 0.2s'
}}
onMouseEnter={(e) => {
e.currentTarget.style.borderTopColor = '#ccc';
}}
onMouseLeave={(e) => {
if (!isResizing) {
e.currentTarget.style.borderTopColor = 'transparent';
}
}}
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we move all of this in a less or css? We could also use a direct import but I think it would be better to use the the less/css option for the following reasons:

  • use of css variable for styling
  • use of pseudoselector to apply border color (e.g.: :hover instead of onMouseEnter/onMouseLeave)

Comment on lines +41 to +53
if (isResizing) {
document.addEventListener('mousemove', handleMouseMove);
document.addEventListener('mouseup', handleMouseUp);
document.body.style.cursor = 'row-resize';
document.body.style.userSelect = 'none';
}

return () => {
document.removeEventListener('mousemove', handleMouseMove);
document.removeEventListener('mouseup', handleMouseUp);
document.body.style.cursor = '';
document.body.style.userSelect = '';
};
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe it's better to use pointer events instead? pointermove pointerup

Comment on lines +26 to +28
<FlexFill classNames={['_relative', 'ms2-layout-content']}>
{children}
</FlexFill>
Copy link
Contributor

Choose a reason for hiding this comment

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

This component container represent the visible content on top of the map, when this component resize we should update also the state of the boundingMapRect of the maplayout reducers. We need to:

  • include a callback inside this component that return information about this component changes (we could use a resize observer). This component should not be directly connected to the state
  • later we will connect this component when we import it in the MapViewer container
  • at the moment we need just to update information for the bottom side, left and right are still managed by the updateMapLayout epic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve the map viewer layout to use different container position

2 participants