• 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

77.78
/web/client/components/map/openlayers/ScaleBar.jsx
1
/**
2
 * Copyright 2015, 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 PropTypes from 'prop-types';
10
import React from 'react';
11
import ScaleLine from 'ol/control/ScaleLine';
12

13
export default class ScaleBar extends React.Component {
14
    static propTypes = {
1✔
15
        map: PropTypes.object,
16
        className: PropTypes.string,
17
        minWidth: PropTypes.number,
18
        units: PropTypes.oneOf(['degrees', 'imperial', 'nautical', 'metric', 'us']),
19
        container: PropTypes.string
20
    };
21

22
    static defaultProps = {
1✔
23
        map: null,
24
        className: 'ol-scale-line',
25
        minWidth: 64,
26
        units: 'metric'
27
    };
28

29
    componentDidMount() {
30
        this.scalebar = new ScaleLine(Object.assign({}, this.props, this.props.container ? {
5✔
31
            target: document.querySelector(this.props.container)
32
        } : {}));
33
        if (this.props.map) {
5!
34
            this.props.map.addControl(this.scalebar);
5✔
35
        }
36
    }
37

38
    componentWillUnmount() {
39
        if (this.props.container && document.querySelector('.ol-scale-line')) {
3!
UNCOV
40
            try {
×
41
                document.querySelector(this.props.container).removeChild(document.querySelector('.ol-scale-line'));
×
42
            } catch (e) {
43
                // do nothing... probably an old configuration
44
            }
45

46
        }
47
    }
48

49
    render() {
50
        return null;
5✔
51
    }
52
}
53

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