• 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

84.0
/app/controller/toolbar/MapTools.js
1
/**
2
 * This class is the controller for the map toolbar of cpsi mapview
3
 *
4
 */
5
Ext.define('CpsiMapview.controller.toolbar.MapTools', {
1✔
6
    extend: 'Ext.app.ViewController',
7

8
    alias: 'controller.cmv_maptools',
9

10
    /**
11
     * Initialize measure buttons
12
     * @param {Ext.button.Button} btn The measure button
13
     */
14
    initializeMeasureBtn: function (btn) {
15
        // avoid showing "null" in IE11 by setting to an empty string
16
        btn.getViewModel().set('clickToDrawText', '');
1✔
17

18
        btn.setBind({
1✔
19
            text: '{measureTooltext}',
20
            tooltip:
21
                btn.measureType === 'line'
1!
22
                    ? '{lineMeasureTooltip}'
23
                    : '{polygonMeasureAreaTooltip}'
24
        });
25
        const tTipStr =
26
            btn.measureType === 'line'
1!
27
                ? btn.getViewModel().get('lineMeasureTooltip')
28
                : btn.getViewModel().get('polygonMeasureAreaTooltip');
29
        btn.tooltipStr = tTipStr;
1✔
30
    },
31

32
    /**
33
     * Limit a gazetteer to only return results within a certain extent
34
     * This sets viewbox and bounded parameters for a Nominatim search
35
     * @param {any} cmb
36
     */
37
    setGazetteerExtent: function (cmb) {
38
        const map = BasiGX.util.Map.getMapComponent().map;
1✔
39

40
        const app = Ext.getApplication
1!
41
            ? Ext.getApplication()
42
            : Ext.app.Application.instance;
43
        const initialExtent = app.initialExtent;
1✔
44

45
        const mv = map.getView();
1✔
46
        cmb.addMapExtentParams(initialExtent, mv.getProjection());
1✔
47
    },
48

49
    init: function () {
50
        // update the loggedIn property on the viewmodel so any role-restricted
51
        // buttons or menus are activated
52
        const me = this;
2✔
53
        Ext.GlobalEvents.on({
2✔
54
            login: function () {
55
                me.getViewModel().set('loggedIn', true);
1✔
56
            },
57
            logout: function () {
58
                me.getViewModel().set('loggedIn', false);
×
59
            }
60
        });
61

62
        // as gx_geocoder_combo does not allow binding of the map property
63
        // set this when the view is created
64
        // TODO add late-binding of the map to gx_geocoder_combo
65
        const map = BasiGX.util.Map.getMapComponent().map;
2✔
66
        const gazetteers = me.getView().query('gx_geocoder_combo');
2✔
67

68
        Ext.each(gazetteers, function (cmb) {
2✔
69
            cmb.map = map;
4✔
70
            cmb.map.addLayer(cmb.locationLayer);
4✔
71
        });
72
    }
73
});
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