• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

geosolutions-it / MapStore2 / 19710972030

26 Nov 2025 03:38PM UTC coverage: 76.665% (-0.3%) from 76.929%
19710972030

Pull #11119

github

web-flow
Fix maven publish (#11739)
Pull Request #11119: Layer Selection Plugin on ArcGIS, WFS & WMS layers

32272 of 50209 branches covered (64.28%)

3 of 3 new or added lines in 2 files covered. (100.0%)

3018 existing lines in 249 files now uncovered.

40157 of 52380 relevant lines covered (76.66%)

37.9 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

91.67
/web/client/reducers/draw.js
1
/*
2
 * Copyright 2017, GeoSolutions Sas.
3
 * All rights reserved.
4
 *
5
 * This source code is licensed under the BSD-style license found in the
6
 * LICENSE file in the root directory of this source tree.
7
*/
8

9
import {
10
    CHANGE_DRAWING_STATUS,
11
    SET_CURRENT_STYLE,
12
    GEOMETRY_CHANGED,
13
    DRAW_SUPPORT_STOPPED,
14
    TOGGLE_SNAPPING,
15
    SET_SNAPPING_LAYER,
16
    SNAPPING_IS_LOADING,
17
    SET_SNAPPING_CONFIG
18
} from '../actions/draw';
19

20
const initialState = {
1✔
21
    drawStatus: null,
22
    drawOwner: null,
23
    drawMethod: null,
24
    options: {},
25
    features: [],
26
    tempFeatures: [],
27
    snapping: false,
28
    snappingIsLoading: false,
29
    snappingLayer: false
30
};
31

32
export const defaultSnappingConfig = { edge: true, vertex: true, pixelTolerance: 10, strategy: 'bbox'};
1✔
33

34
function draw(state = initialState, action) {
15✔
35
    switch (action.type) {
42!
36
    case CHANGE_DRAWING_STATUS:
37
        return Object.assign({}, state, {
1✔
38
            drawStatus: action.status,
39
            drawOwner: action.owner,
40
            drawMethod: action.method,
41
            options: action.options,
42
            features: action.features,
43
            style: action.style
44
        });
45
    case SET_CURRENT_STYLE:
46
        return Object.assign({}, state, {
1✔
47
            currentStyle: action.currentStyle
48
        });
49
    case GEOMETRY_CHANGED:
50
        return Object.assign({}, state, {tempFeatures: action.features});
1✔
51
    case DRAW_SUPPORT_STOPPED:
UNCOV
52
        return Object.assign({}, state, {tempFeatures: []});
×
53
    case TOGGLE_SNAPPING:
54
        return {
1✔
55
            ...state,
56
            snapping: !state.snapping
57
        };
58
    case SET_SNAPPING_LAYER:
59
        return {
1✔
60
            ...state,
61
            snappingLayer: action.snappingLayer,
62
            snappingIsLoading: false
63
        };
64
    case SNAPPING_IS_LOADING:
65
        return {
1✔
66
            ...state,
67
            snappingIsLoading: !state.snappingIsLoading
68
        };
69
    case SET_SNAPPING_CONFIG:
70
        return {
4✔
71
            ...state,
72
            snapConfig: {
73
                ...({...defaultSnappingConfig, ...(action.pluginCfg?.snapConfig || {})}),
7✔
74
                ...(state?.snapConfig ?? {}),
6✔
75
                ...(action.prop && typeof action.value !== 'undefined' ? {[action.prop]: action.value} : {})
9✔
76
            }
77
        };
78
    default:
79
        return state;
32✔
80
    }
81
}
82

83
export default draw;
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc