-
Notifications
You must be signed in to change notification settings - Fork 394
Expand file tree
/
Copy pathBaseMapTraits.ts
More file actions
82 lines (73 loc) · 2.67 KB
/
BaseMapTraits.ts
File metadata and controls
82 lines (73 loc) · 2.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
import CatalogMemberFactory from "../../Models/Catalog/CatalogMemberFactory";
import modelReferenceTrait from "../Decorators/modelReferenceTrait";
import objectArrayTrait from "../Decorators/objectArrayTrait";
import primitiveArrayTrait from "../Decorators/primitiveArrayTrait";
import primitiveTrait from "../Decorators/primitiveTrait";
import ModelReference from "../ModelReference";
import ModelTraits from "../ModelTraits";
export class BaseMapTraits extends ModelTraits {
@primitiveTrait({
type: "string",
name: "Image",
description: "Path to the basemap image"
})
image?: string;
@primitiveTrait({
type: "string",
name: "Contrast color",
description:
"Color which should be used to contrast with basemap (eg for region mapping feature borders)"
})
contrastColor?: string = "#ffffff";
@primitiveTrait({
type: "string",
name: "Background color",
description:
"Background color to use for the map container when showing this base map. This setting is currently only applicable in Leaflet or 2D mode. It is useful when the base map does not cover the entire screen and a background color matching the overall base map style is desired."
})
backgroundColor?: string;
@modelReferenceTrait({
factory: CatalogMemberFactory,
name: "Base map item",
description:
'Catalog item definition to be used for the base map. It is also possible to reference an existing catalog item using its id (i.e. `"//Surface Geology"`).'
})
item?: ModelReference;
}
export class BaseMapsTraits extends ModelTraits {
@primitiveTrait({
type: "string",
name: "defaultBaseMapId",
description:
"The id of the baseMap user will see on the first mapLoad. This wil be used **before** `defaultBaseMapName`"
})
defaultBaseMapId?: string;
@primitiveTrait({
type: "string",
name: "defaultBaseMapName",
description: "Name of the base map to use as default"
})
defaultBaseMapName?: string;
@primitiveTrait({
type: "string",
name: "previewBaseMapId",
description:
"The id of the baseMap to be used as the base map in data preview. "
})
previewBaseMapId?: string = "basemap-natural-earth-II";
@objectArrayTrait<BaseMapTraits>({
type: BaseMapTraits,
idProperty: "item",
name: "items",
description:
"Array of catalog items definitions that can be used as a Base map."
})
items?: BaseMapTraits[];
@primitiveArrayTrait({
type: "string",
name: "enabledBaseMaps",
description:
"Array of base maps ids that is available to user. Use this do define order of the base maps in settings panel. Leave undefined to show all basemaps."
})
enabledBaseMaps?: string[];
}