Skip to content
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
014dbae
Add Translations
arxitpln May 20, 2025
8977b5b
Add configs
arxitpln May 20, 2025
dc8f867
Add Select to plugins
arxitpln May 20, 2025
21d1a3b
Correction on getCQLGeometryElement
arxitpln May 20, 2025
be98cad
Add treeHeadr to TOC and LayerTree
arxitpln May 20, 2025
ca0a494
tooltip → description
arxitpln May 20, 2025
cb7625b
Salect → SelectPlugin
arxitpln May 20, 2025
1ea363c
Add select Code
arxitpln May 20, 2025
e23cb1e
Select → LayersSelection in translations
arxitpln Jun 6, 2025
2183893
Select → LayersSelection for configs
arxitpln Jun 6, 2025
6b790cb
Select → LayersSelection for plugins
arxitpln Jun 6, 2025
bb840f7
Select → LayersSelection for the plugin
arxitpln Jun 6, 2025
0075d05
Add LayersSelect JsDoc
arxitpln Jul 25, 2025
5ef5be2
Remove extra comments and extra ={true}
jlo-arxit Nov 6, 2025
d97c9f1
Correct plugin name in CreatePlugin function
jlo-arxit Nov 6, 2025
18e31bd
Remove LayersSelection plugin from localconfig.json and simple.json
jlo-arxit Nov 6, 2025
e61f57b
Disable plugin in 3D
jlo-arxit Nov 6, 2025
770b88e
LayersSelections move to plugin directory as index,js
bgr-arxit Nov 20, 2025
05a1392
standardize icon
bgr-arxit Nov 20, 2025
d41576b
uncomment bounding box on ellipsis
bgr-arxit Nov 20, 2025
44bc94c
fix unique id of added layers
bgr-arxit Nov 20, 2025
b52da98
fix layers added
bgr-arxit Nov 20, 2025
0a907e2
use only less variable for color
bgr-arxit Nov 26, 2025
803bad7
use less variable
bgr-arxit Nov 26, 2025
1f0f922
clean code
bgr-arxit Nov 27, 2025
c97723b
correct translation
bgr-arxit Nov 27, 2025
d931503
fix theming usage
bgr-arxit Nov 27, 2025
b590f45
clena code
bgr-arxit Nov 28, 2025
e7c0394
rename reducer as layerSelection
bgr-arxit Nov 28, 2025
d15cff0
rename reducer as layerSelection
bgr-arxit Nov 28, 2025
d572f44
Add Translations
arxitpln May 20, 2025
ad8b042
Add configs
arxitpln May 20, 2025
9ee69ed
Add Select to plugins
arxitpln May 20, 2025
830185b
Correction on getCQLGeometryElement
arxitpln May 20, 2025
4012a45
Add treeHeadr to TOC and LayerTree
arxitpln May 20, 2025
7b78fa2
tooltip → description
arxitpln May 20, 2025
cc60750
Salect → SelectPlugin
arxitpln May 20, 2025
a350031
Add select Code
arxitpln May 20, 2025
3358fb2
Select → LayersSelection in translations
arxitpln Jun 6, 2025
2767693
Select → LayersSelection for configs
arxitpln Jun 6, 2025
0c8396c
Select → LayersSelection for plugins
arxitpln Jun 6, 2025
5bc14e2
Select → LayersSelection for the plugin
arxitpln Jun 6, 2025
0e6bf2f
Add LayersSelect JsDoc
arxitpln Jul 25, 2025
938081c
Remove extra comments and extra ={true}
jlo-arxit Nov 6, 2025
84af025
Correct plugin name in CreatePlugin function
jlo-arxit Nov 6, 2025
ed54f71
Remove LayersSelection plugin from localconfig.json and simple.json
jlo-arxit Nov 6, 2025
d4c7bd3
Disable plugin in 3D
jlo-arxit Nov 6, 2025
f08342d
LayersSelections move to plugin directory as index,js
bgr-arxit Nov 20, 2025
12387fa
standardize icon
bgr-arxit Nov 20, 2025
6476a1d
uncomment bounding box on ellipsis
bgr-arxit Nov 20, 2025
80dfae1
fix unique id of added layers
bgr-arxit Nov 20, 2025
f9aab22
fix layers added
bgr-arxit Nov 20, 2025
c73bbda
use only less variable for color
bgr-arxit Nov 26, 2025
8ad950a
use less variable
bgr-arxit Nov 26, 2025
adeed26
clean code
bgr-arxit Nov 27, 2025
fc15b8d
correct translation
bgr-arxit Nov 27, 2025
545360b
fix theming usage
bgr-arxit Nov 27, 2025
e97ffc7
clena code
bgr-arxit Nov 28, 2025
1976d18
rename reducer as layerSelection
bgr-arxit Nov 28, 2025
45cf1eb
rename reducer as layerSelection
bgr-arxit Nov 28, 2025
83ac5d5
Merge branch 'master' of https://github.com/geosolutions-it/MapStore2…
allyoucanmap Jan 13, 2026
262c841
ui and drawing refactor
allyoucanmap Jan 13, 2026
0243cbe
ensure states is cleared on map change
allyoucanmap Jan 13, 2026
6809ed0
rename plugin directory
allyoucanmap Jan 13, 2026
5fbb600
rename plugin directory
allyoucanmap Jan 13, 2026
de9b2f0
include plugin in jsdoc
allyoucanmap Jan 13, 2026
0173f7b
ensure the 4326 projection output on arcgis layer
allyoucanmap Jan 13, 2026
73f3362
format json files
allyoucanmap Jan 13, 2026
5e95477
merge latest edit by AllYouCanMap
bgr-arxit Jan 27, 2026
8634707
add uunit test
bgr-arxit Jan 27, 2026
ee94b0f
fix docma config
bgr-arxit Jan 27, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions project/standard/templates/configs/pluginsConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,17 @@
"description": "plugins.Permalink.description",
"denyUserSelection": true
},
{
"name": "LayersSelection",
"glyph": "hand-down",
"title": "plugins.LayersSelection.title",
"description": "plugins.LayersSelection.description",
"dependencies": [
"Toolbar",
"BurgerMenu",
"SidebarMenu"
]
},
{
"name": "BackgroundSelector",
"title": "plugins.BackgroundSelector.title",
Expand Down
23 changes: 23 additions & 0 deletions web/client/configs/localConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,29 @@
"containerPosition": "header"
}
},
{
"name": "LayersSelection",
"cfg": {
"highlightOptions": {
"color": "#3388ff",
"dashArray": "",
"fillColor": "#3388ff",
"fillOpacity": 0.2,
"radius": 4,
"weight": 4
},
"queryOptions": {
"maxCount": -1
},
"selectTools": [
"Point",
"Line",
"Circle",
"Rectangle",
"Polygon"
]
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This plugin should be available only in contexts so we should remove it from localConfig.json

{ "name": "SecurityPopup" },
{
"name": "Map",
Expand Down
11 changes: 11 additions & 0 deletions web/client/configs/pluginsConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,17 @@
"title": "plugins.Permalink.title",
"description": "plugins.Permalink.description"
},
{
"name": "LayersSelection",
"glyph": "hand-down",
"title": "plugins.LayersSelection.title",
"description": "plugins.LayersSelection.description",
"dependencies": [
"Toolbar",
"BurgerMenu",
"SidebarMenu"
]
},
{
"name": "BackgroundSelector",
"title": "plugins.BackgroundSelector.title",
Expand Down
23 changes: 23 additions & 0 deletions web/client/configs/simple.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,29 @@
"zoomControl": false
}
},
{
"name": "LayersSelection",
"cfg": {
"highlightOptions": {
"color": "#3388ff",
"dashArray": "",
"fillColor": "#3388ff",
"fillOpacity": 0.2,
"radius": 4,
"weight": 4
},
"queryOptions": {
"maxCount": -1
},
"selectTools": [
"Point",
"Line",
"Circle",
"Rectangle",
"Polygon"
]
}
},
Copy link
Contributor

Choose a reason for hiding this comment

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

This plugin should be available only in contexts so we should remove it from simple.json

{
"name": "Help"
},
Expand Down
96 changes: 96 additions & 0 deletions web/client/plugins/LayersSelection.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
import React from 'react';
import { connect } from 'react-redux';
import { createSelector } from 'reselect';
import { get } from 'lodash';
import { Glyphicon } from 'react-bootstrap';

import { createPlugin } from '../utils/PluginsUtils';
import { layersSelector } from '../selectors/layers';
import { updateNode, addLayer, changeLayerProperties } from '../actions/layers';
import { zoomToExtent } from '../actions/map';
import controls from '../reducers/controls';
import { toggleControl } from '../actions/controls';
import Message from '../components/I18N/Message';

import SelectComponent from './layersSelection/components/LayersSelection';
import epics from './layersSelection/epics/layersSelection';
import select from './layersSelection/reducers/layersSelection';
import { storeConfiguration, cleanSelection, addOrUpdateSelection } from './layersSelection/actions/layersSelection';
import { getSelectSelections, getSelectQueryMaxFeatureCount } from './layersSelection/selectors/layersSelection';

/**
* Select plugin that enables layer feature selection in the map.
* It connects Redux state and actions to the SelectComponent UI.
* Uses selectors to retrieve visibility, layers, selection results, and feature count.
*
* @function
* @returns {Object} A plugin definition object used by the application to render and control the Select tool.
*/
export default createPlugin('Select', {
Copy link
Contributor

Choose a reason for hiding this comment

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

The map viewer remains empty because the configured name here is wrong.
The name should be LayersSelection.

component: connect(
createSelector([
(state) => get(state, 'controls.select.enabled'),
layersSelector,
getSelectSelections,
getSelectQueryMaxFeatureCount
], (isVisible, layers, selections, maxFeatureCount) => ({
isVisible,
layers,
selections,
maxFeatureCount
})),
{
onClose: toggleControl.bind(null, 'select', null),
onUpdateNode: updateNode,
storeConfiguration,
cleanSelection,
addOrUpdateSelection,
zoomToExtent,
addLayer,
changeLayerProperties
}
)(SelectComponent),
options: {
disablePluginIf: "{state('router') && (state('router').endsWith('new') || state('router').includes('newgeostory') || state('router').endsWith('dashboard'))}"
Copy link
Contributor

Choose a reason for hiding this comment

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

This disablePluginIf configuration does not seem related to this plugin. We should remove it

},
reducers: {
...controls,
Copy link
Contributor

Choose a reason for hiding this comment

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

A reducer should not be spread. In this case if we want also to ensure controls reducer is included we should review reducers as:

reducers: {
  controls,
  layersSelection
}

And instead of select I propose to change the name of reducer to layersSelection

select
},
epics: epics,
containers: {
BurgerMenu: {
name: 'select',
position: 1000,
priority: 2,
doNotHide: true,
text: <Message msgId="layersSelection.title"/>,
tooltip: <Message msgId="layersSelection.tooltip"/>,
icon: <Glyphicon glyph="hand-down"/>,
action: toggleControl.bind(null, 'select', null),
toggle: true
},
SidebarMenu: {
name: 'select',
position: 1000,
priority: 1,
doNotHide: true,
text: <Message msgId="layersSelection.title"/>,
tooltip: <Message msgId="layersSelection.tooltip"/>,
icon: <Glyphicon glyph="hand-down"/>,
action: toggleControl.bind(null, 'select', null),
toggle: true
},
Toolbar: {
name: 'select',
alwaysVisible: true,
position: 2,
priority: 0,
doNotHide: true,
tooltip: <Message msgId="layersSelection.title"/>,
icon: <Glyphicon glyph="hand-down"/>,
action: toggleControl.bind(null, 'select', null),
toggle: true
}
}
});
5 changes: 4 additions & 1 deletion web/client/plugins/TOC/components/LayersTree.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ const loopGroupCondition = (groupNode, condition) => {
* @prop {string} noFilteredResultsMsgId message id for no result on filter
* @prop {object} config optional configuration available for the nodes
* @prop {boolean} config.sortable activate the possibility to sort nodes
* @prop {component} treeHeader display a header on top of the layer tree
*/
const LayersTree = ({
tree,
Expand All @@ -90,7 +91,8 @@ const LayersTree = ({
nodeToolItems,
nodeContentItems,
singleDefaultGroup = isSingleDefaultGroup(tree),
theme
theme,
treeHeader
}) => {

const containerNode = useRef();
Expand Down Expand Up @@ -151,6 +153,7 @@ const LayersTree = ({
event.preventDefault();
}}
>
{treeHeader ?? null}
{(root || []).map((node, index) => {
return (
<DefaultLayerOrGroup
Expand Down
10 changes: 8 additions & 2 deletions web/client/plugins/TOC/components/TOC.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ import {
* @prop {boolean} config.layerOptions.hideLegend hide the legend of the layer
* @prop {object} config.layerOptions.legendOptions additional options for WMS legend
* @prop {boolean} config.layerOptions.hideFilter hide the filter button in the layer nodes
* @prop {component} treeHeader display a header on top of the layer tree
*/
export function ControlledTOC({
tree,
Expand All @@ -77,7 +78,8 @@ export function ControlledTOC({
nodeToolItems,
nodeContentItems,
singleDefaultGroup,
theme
theme,
treeHeader
}) {
return (
<LayersTree
Expand All @@ -104,6 +106,7 @@ export function ControlledTOC({
nodeToolItems={nodeToolItems}
nodeContentItems={nodeContentItems}
singleDefaultGroup={singleDefaultGroup}
treeHeader={treeHeader}
/>
);
}
Expand Down Expand Up @@ -140,6 +143,7 @@ export function ControlledTOC({
* @prop {boolean} config.layerOptions.hideLegend hide the legend of the layer
* @prop {object} config.layerOptions.legendOptions additional options for WMS legend
* @prop {boolean} config.layerOptions.hideFilter hide the filter button in the layer nodes
* @prop {component} treeHeader display a header on top of the layer tree
*/
function TOC({
map = { layers: [], groups: [] },
Expand All @@ -154,7 +158,8 @@ function TOC({
singleDefaultGroup,
nodeItems,
theme,
filterText
filterText,
treeHeader
}) {
const { layers } = splitMapAndLayers(map) || {};
const tree = denormalizeGroups(layers.flat || [], layers.groups || []).groups;
Expand Down Expand Up @@ -218,6 +223,7 @@ function TOC({
nodeToolItems={nodeToolItems}
nodeContentItems={nodeContentItems}
singleDefaultGroup={singleDefaultGroup}
treeHeader={treeHeader}
/>
);
}
Expand Down
44 changes: 44 additions & 0 deletions web/client/plugins/layersSelection/actions/layersSelection.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
export const SELECT_CLEAN_SELECTION = "SELECT:CLEAN_SELECTION";
export const SELECT_STORE_CFG = "SELECT:STORE_CFG";
export const ADD_OR_UPDATE_SELECTION = "SELECT:ADD_OR_UPDATE_SELECTION";

/**
* Action creator to clean the current selection based on geometry type.
*
* @param {string} geomType - The type of geometry to clean (e.g., "Point", "Polygon").
* @returns {{ type: string, geomType: string }} The action object.
*/
export function cleanSelection(geomType) {
return {
type: SELECT_CLEAN_SELECTION,
geomType
};
}

/**
* Action creator to store configuration settings related to selection.
*
* @param {Object} cfg - Configuration object to store.
* @returns {{ type: string, cfg: Object }} The action object.
*/
export function storeConfiguration(cfg) {
return {
type: SELECT_STORE_CFG,
cfg
};
}

/**
* Action creator to add or update a layer selection with GeoJSON data.
*
* @param {string} layer - The name or ID of the layer.
* @param {Object} geoJsonData - The GeoJSON data representing the selection.
* @returns {{ type: string, layer: string, geoJsonData: Object }} The action object.
*/
export function addOrUpdateSelection(layer, geoJsonData) {
return {
type: ADD_OR_UPDATE_SELECTION,
layer,
geoJsonData
};
}
40 changes: 40 additions & 0 deletions web/client/plugins/layersSelection/assets/select.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
.ms-resizable-modal > .modal-content.select-dialog {
top: 0vh;
right: -100vw;
}

.select-content * .ms-node-title {
font-weight: bold;
}

.select-content * .ms-node-header-info > .ms-node-header-addons:nth-child(3) {
flex: 1 ;
justify-content: space-between;
}

.features-count-displayer{
display: flex;
}

.title-container {
display: flex;
}

.title-icon {
height: 100%;
width: auto;
margin-right: 0.5em;
}

.title-title {
flex-grow: 1;
text-align: center;
}

.tree-header {
background-color: #E9EDF4;
}

.features-count {
font-weight: bold;
}
Loading