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

geosolutions-it / MapStore2 / 15704025608

17 Jun 2025 09:52AM UTC coverage: 76.967% (+0.007%) from 76.96%
15704025608

push

github

web-flow
Remove object assign pollyfills (#11214)

* chore: Remove unused package babel-plugin-object-assign

* chore: Remove es6-object-assign

* refactor: Replace object-assign with Object.assign

* Fixed other object assign

* Thanks to @jna-nordiq for this contribution

---------

Co-authored-by: Jonas <jonasnaursgaard.jensen@sweco.dk>

31117 of 48419 branches covered (64.27%)

457 of 567 new or added lines in 94 files covered. (80.6%)

4 existing lines in 3 files now uncovered.

38718 of 50305 relevant lines covered (76.97%)

36.34 hits per line

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

25.0
/web/client/components/map/leaflet/plugins/BingLayer.js
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
import L from 'leaflet';
9
import Layers from '../../../../utils/leaflet/Layers';
10
import 'leaflet-plugins/layer/tile/Bing';
11

12
L.BingLayer.prototype.loadMetadata = function() {
1✔
13
    if (this.metaRequested) {
×
14
        return;
×
15
    }
16
    this.metaRequested = true;
×
17
    const _this = this;
×
18
    const cbid = '_bing_metadata_' + L.Util.stamp(this);
×
19
    window[cbid] = function(meta) {
×
20
        _this.meta = meta;
×
21
        window[cbid] = undefined;
×
22
        const e = document.getElementById(cbid);
×
23
        e.parentNode.removeChild(e);
×
24
        if (meta.errorDetails) {
×
25
            _this.fire('load', {layer: _this});
×
26
            return _this.onError(meta);
×
27
        }
28
        _this.initMetadata(meta);
×
29
        return null;
×
30
    };
31
    const urlScheme = document.location.protocol === 'file:' ? 'https' : document.location.protocol.slice(0, -1);
×
32
    const url = urlScheme + '://dev.virtualearth.net/REST/v1/Imagery/Metadata/'
×
33
                + this.options.type + '?include=ImageryProviders&jsonp=' + cbid +
34
                '&key=' + this._key + '&UriScheme=' + urlScheme;
35
    const script = document.createElement('script');
×
36
    script.type = 'text/javascript';
×
37
    script.src = url;
×
38
    script.id = cbid;
×
39
    document.getElementsByTagName('head')[0].appendChild(script);
×
40
};
41
L.BingLayer.prototype.onError = function(meta) {
1✔
42
    if (this.options.onError) {
×
43
        return this.options.onError(meta);
×
44
    }
45
    return null;
×
46
};
47

48

49
Layers.registerType('bing', {
1✔
50
    create: (options) => {
51
        var key = options.apiKey;
1✔
52
        let layerOptions = {
1✔
53
            subdomains: [0, 1, 2, 3],
54
            type: options.name,
55
            attribution: 'Bing',
56
            culture: '',
57
            onError: options.onError,
58
            maxNativeZoom: options.maxNativeZoom || 19,
2✔
59
            maxZoom: options.maxZoom || 23
2✔
60
        };
61
        if (options.zoomOffset) {
1!
NEW
62
            layerOptions = Object.assign({}, layerOptions, {
×
63
                zoomOffset: options.zoomOffset
64
            });
65
        }
66
        return new L.BingLayer(key, layerOptions);
1✔
67
    },
68
    isValid: (layer) => {
69
        if (layer.meta && layer.meta.statusCode && layer.meta.statusCode !== 200) {
2!
70
            return false;
×
71
        }
72
        return true;
2✔
73
    }
74
});
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