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

jumpinjackie / mapguide-react-layout / 15165370206

21 May 2025 02:48PM UTC coverage: 22.447%. Remained the same
15165370206

push

github

jumpinjackie
#1555: More internalization of things that shouldn't be in the API documentation.

Also dd merge-modules plugin for typedoc which flattens our public symbol list, which makes better sense as our node module usage story is to import from a flat barrel "mapguide-react-layout" module.

878 of 1206 branches covered (72.8%)

4975 of 22163 relevant lines covered (22.45%)

6.95 hits per line

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

0.0
/src/api/base-layer-set.ts
1
/**
1✔
2
 * @module
3
 * @hidden
4
 */
5

6
import { ILayerSetOL } from './layer-set-contracts';
7
import LayerGroup from 'ol/layer/Group';
8
import { Bounds, IExternalBaseLayer, RefreshMode, LayerTransparencySet, Size } from './common';
9
import View from 'ol/View';
10
import LayerBase from "ol/layer/Base";
11
import * as olHas from "ol/has";
×
12
import Source from 'ol/source/Source';
13
import { ProjectionLike } from 'ol/proj';
14

15
/**
16
 * @hidden
17
 */
18
export abstract class BaseLayerSetOL implements ILayerSetOL {
×
19
    constructor(public readonly externalBaseLayersGroup: LayerGroup | undefined,
×
20
        public readonly projection: ProjectionLike,
×
21
        public readonly dpi: number,
×
22
        public readonly extent: Bounds,
×
23
        private readonly inPerUnit: number,
×
24
        public readonly view: View) {
×
25

26
    }
×
27
    public getMetersPerUnit(): number {
×
28
        return this.inPerUnit / 39.37
×
29
    }
×
30
    public scaleToResolution(scale: number): number {
×
31
        return (scale / this.inPerUnit / this.dpi) * olHas.DEVICE_PIXEL_RATIO;
×
32
    }
×
33
    public resolutionToScale(resolution: number): number {
×
34
        return (resolution * this.dpi * this.inPerUnit) / olHas.DEVICE_PIXEL_RATIO;
×
35
    }
×
36
    public updateExternalBaseLayers(externalBaseLayers: IExternalBaseLayer[]) {
×
37
        if (this.externalBaseLayersGroup) {
×
38
            const layers = this.externalBaseLayersGroup.getLayers();
×
39
            layers.forEach((l: LayerBase) => {
×
40
                const match = (externalBaseLayers || []).filter(el => el.name === l.get("title"));
×
41
                if (match.length == 1) {
×
42
                    l.setVisible(!!match[0].visible);
×
43
                } else {
×
44
                    l.setVisible(false);
×
45
                }
×
46
            });
×
47
        }
×
48
    }
×
49
    /**
50
     *
51
     * @virtual
52
     * @param {RefreshMode} mode
53
     */
54
    refreshMap(mode: RefreshMode): void { }
×
55
    abstract getLayers(): LayerBase[];
56
    abstract getSourcesForProgressTracking(): Source[];
57
    abstract updateTransparency(trans: LayerTransparencySet): void;
58
    /**
59
     * 
60
     * @param mapExtent 
61
     * @param size @deprecated This parameter is no longer used and will be removed in a later release
62
     * @param uri 
63
     * 
64
     * @since 0.15 Deprecated size parameter
65
     */
66
    abstract showActiveSelectedFeature(mapExtent: Bounds, size: Size, uri: string): void;
67
    abstract update(showGroups: string[] | undefined, showLayers: string[] | undefined, hideGroups: string[] | undefined, hideLayers: string[] | undefined): void;
68
    abstract updateSelectionColor(color: string): void;
69
}
×
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