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

compassinformatics / cpsi-mapview / 15022980938

14 May 2025 02:11PM UTC coverage: 26.333% (+0.04%) from 26.29%
15022980938

push

github

geographika
Move describe to test globals

492 of 2344 branches covered (20.99%)

Branch coverage included in aggregate %.

1464 of 5084 relevant lines covered (28.8%)

1.17 hits per line

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

2.94
/app/controller/window/ParallelLineWindow.js
1
/**
2
 * This class is the controller for the ParallelLine.
3
 */
4
Ext.define('CpsiMapview.controller.window.ParallelLineWindow', {
1✔
5
    extend: 'Ext.app.ViewController',
6

7
    alias: 'controller.cmv_parallel_line_window',
8

9
    requires: ['BasiGX.view.component.Map'],
10

11
    selectInteraction: null,
12

13
    layer: null,
14

15
    onSelectFeatureToggle: function (btn, toggled) {
16
        const me = this;
×
17
        const view = me.getView();
×
18
        const vm = view.getViewModel();
×
19
        const map = BasiGX.view.component.Map.guess().getMap();
×
20
        if (toggled) {
×
21
            const interactionConfig = view.interactionConfig
×
22
                ? view.interactionConfig
23
                : {};
24
            this.selectInteraction = new ol.interaction.Select(
×
25
                interactionConfig
26
            );
27
            this.selectInteraction.on('select', function (evt) {
×
28
                const selectedFeature = evt.selected[0];
×
29
                vm.set('selectedFeature', selectedFeature);
×
30
            });
31
            map.addInteraction(this.selectInteraction);
×
32
        } else {
33
            if (!this.selectInteraction) {
×
34
                return;
×
35
            }
36
            map.removeInteraction(this.selectInteraction);
×
37
            this.selectInteraction = null;
×
38
        }
39
    },
40

41
    onParallelLineCreated: function (newLineFeature) {
42
        if (this.layer === null) {
×
43
            this.layer = new ol.layer.Vector();
×
44
            const map = BasiGX.view.component.Map.guess().getMap();
×
45
            if (map) {
×
46
                map.addLayer(this.layer);
×
47
            }
48
        }
49
        const source = new ol.source.Vector({
×
50
            features: [newLineFeature]
51
        });
52
        this.layer.setSource(source);
×
53
    },
54

55
    onBeforeDestroy: function () {
56
        // remove select interaction
57
        this.onSelectFeatureToggle(null, false);
×
58
    }
59
});
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

© 2026 Coveralls, Inc