@siemens/maps-ng 47.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +20 -0
- package/README.md +119 -0
- package/assets/default-marker-icon.svg +9 -0
- package/assets/marker-default.svg +7 -0
- package/components/si-map/components/index.d.ts +6 -0
- package/components/si-map/components/si-map-popover/si-map-popover-cluster-template.directive.d.ts +9 -0
- package/components/si-map/components/si-map-popover/si-map-popover-template.directive.d.ts +9 -0
- package/components/si-map/components/si-map-popover/si-map-popover.component.d.ts +25 -0
- package/components/si-map/components/si-map-tooltip/si-map-tooltip.component.d.ts +39 -0
- package/components/si-map/index.d.ts +9 -0
- package/components/si-map/models/color-palette.type.d.ts +9 -0
- package/components/si-map/models/constants.d.ts +32 -0
- package/components/si-map/models/grouping.model.d.ts +13 -0
- package/components/si-map/models/index.d.ts +9 -0
- package/components/si-map/models/map-point.interface.d.ts +78 -0
- package/components/si-map/models/overlay-native-properties.interface.d.ts +17 -0
- package/components/si-map/services/SelectCluster.d.ts +16 -0
- package/components/si-map/services/map.service.d.ts +85 -0
- package/components/si-map/shared/themes/element.d.ts +17 -0
- package/components/si-map/shared/themes/marker.d.ts +7 -0
- package/components/si-map/shared/themes/style.d.ts +5 -0
- package/components/si-map/si-map.component.d.ts +406 -0
- package/components/si-map/si-map.module.d.ts +9 -0
- package/fesm2022/siemens-maps-ng-translate.mjs +21 -0
- package/fesm2022/siemens-maps-ng-translate.mjs.map +1 -0
- package/fesm2022/siemens-maps-ng.mjs +4895 -0
- package/fesm2022/siemens-maps-ng.mjs.map +1 -0
- package/index.d.ts +5 -0
- package/package.json +50 -0
- package/projects/maps-ng/README.md +119 -0
- package/public-api.d.ts +7 -0
- package/public-api.module.d.ts +8 -0
- package/translate/index.d.ts +6 -0
- package/translate/package.json +3 -0
- package/translate/si-translatable-keys.interface.d.ts +7 -0
- package/translate/si-translatable-overrides.provider.d.ts +7 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
The MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) Siemens 2016 - 2025
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the “Software”), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
# Element Maps
|
|
2
|
+
|
|
3
|
+
Element maps library based on OpenLayers.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
To use this library in other projects, add it to your dependencies using:
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install --save @siemens/maps-ng
|
|
11
|
+
|
|
12
|
+
# Also install the needed peer dependencies
|
|
13
|
+
npm install --save ol@~10.2.0 ol-ext ol-mapbox-style
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Add library assets and CommonJs dependencies in your _angular.json_ under the build options
|
|
17
|
+
|
|
18
|
+
```json
|
|
19
|
+
{
|
|
20
|
+
"architect": {
|
|
21
|
+
"build": {
|
|
22
|
+
"options": {
|
|
23
|
+
"assets": [
|
|
24
|
+
// ... other assets
|
|
25
|
+
{
|
|
26
|
+
"glob": "**/*",
|
|
27
|
+
"input": "./node_modules/@siemens/maps-ng/assets",
|
|
28
|
+
"output": "/assets/"
|
|
29
|
+
}
|
|
30
|
+
],
|
|
31
|
+
// ... other options
|
|
32
|
+
"allowedCommonJsDependencies": [
|
|
33
|
+
"xml-utils/find-tags-by-name.js",
|
|
34
|
+
"xml-utils/get-attribute.js",
|
|
35
|
+
"web-worker",
|
|
36
|
+
"pbf",
|
|
37
|
+
"earcut",
|
|
38
|
+
"rbush"
|
|
39
|
+
]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
Import openlayers styles into your main global stylesheet
|
|
47
|
+
|
|
48
|
+
```scss
|
|
49
|
+
@use 'ol/ol.css';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
Add the library to the list of _imports_ in your Angular _AppModule_ like this:
|
|
53
|
+
|
|
54
|
+
```ts
|
|
55
|
+
// [...]
|
|
56
|
+
|
|
57
|
+
// Import this library and required dependencies
|
|
58
|
+
import { SiMapModule } from '@siemens/maps-ng';
|
|
59
|
+
|
|
60
|
+
@NgModule({
|
|
61
|
+
declarations: [AppComponent],
|
|
62
|
+
imports: [
|
|
63
|
+
BrowserModule,
|
|
64
|
+
|
|
65
|
+
// Import this library
|
|
66
|
+
SiMapModule
|
|
67
|
+
],
|
|
68
|
+
bootstrap: [AppComponent]
|
|
69
|
+
})
|
|
70
|
+
export class AppModule {}
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
Or simply _import_ the `SiMapComponent` in your standalone component.
|
|
74
|
+
|
|
75
|
+
```ts
|
|
76
|
+
@Component({
|
|
77
|
+
selector: 'app-map',
|
|
78
|
+
standalone: true,
|
|
79
|
+
imports: [SiMapComponent],
|
|
80
|
+
templateUrl: './sample.component.html',
|
|
81
|
+
host: { class: 'h-100' }
|
|
82
|
+
})
|
|
83
|
+
export class SampleComponent {}
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
And lastly, add the map to your template and add a MapTiler key.
|
|
87
|
+
Note, the map has not height per default and comes with a `block`
|
|
88
|
+
display. Set the height or put it in a related container.
|
|
89
|
+
|
|
90
|
+
The demo key works on localhost. It will be renewed regularly
|
|
91
|
+
to avoid missuses of the key. Contact the SiMPL team to receive
|
|
92
|
+
a key for your SI BP product.
|
|
93
|
+
|
|
94
|
+
```html
|
|
95
|
+
<si-map [maptilerKey]="'REPLACE_WITH_YOUR_MAPTILER_KEY'" style="height: 500px;"></si-map>
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Testing
|
|
99
|
+
|
|
100
|
+
Do **not** load map data (tiles) from maptiler in automated tests, to reduce the number of
|
|
101
|
+
payed requests to a minimum. E.g. during testing, you want to test your functions and not the
|
|
102
|
+
tile data provided by maptiler.
|
|
103
|
+
|
|
104
|
+
- **Unit tests:** Do simply **not** provide an API key during
|
|
105
|
+
- **Playwright tests:** Stub the `tiles.json` request (and some others) using [page.route(...)](playwright/e2e/simpl-element/maps/static.spec.ts).
|
|
106
|
+
|
|
107
|
+
### Running Unit Tests
|
|
108
|
+
|
|
109
|
+
Run `yarn maps:test` to perform the unit tests via [Karma](https://karma-runner.github.io).
|
|
110
|
+
You can set a seed for running the tests in a specific using an environment variable: `SEED=71384 yarn maps:test`
|
|
111
|
+
|
|
112
|
+
## License
|
|
113
|
+
|
|
114
|
+
The following applies for code and documentation of the git repository,
|
|
115
|
+
unless explicitly mentioned.
|
|
116
|
+
|
|
117
|
+
Copyright (c) Siemens 2016 - 2025
|
|
118
|
+
|
|
119
|
+
MIT, see [LICENSE.md](LICENSE.md).
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
<svg width="30" height="30" viewBox="0 0 30 30" fill="none" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
|
|
2
|
+
<rect x="2" y="2" width="25" height="25" fill="url(#pattern0)"/>
|
|
3
|
+
<defs>
|
|
4
|
+
<pattern id="pattern0" patternContentUnits="objectBoundingBox" width="1" height="1">
|
|
5
|
+
<use xlink:href="#image0" transform="scale(0.02)"/>
|
|
6
|
+
</pattern>
|
|
7
|
+
<image id="image0" width="50" height="50" xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAABmJLR0QA/wD/AP+gvaeTAAADJklEQVRoge2az4tVZRyHn9d+TOKULRKVhBQUzIRmFbZo0aJNKP4BBe38A3ThTkFC3LjIQUaahW7bBJEtJAgKKxVFAynDUJSRYVBU0oHx59PinOQ6TPd+3/eee49IDwxc7vmc9/0+9z0/3vOegeeE1GRj6qvAZuBDYAxYDbxeb74NXAZ+A34Avksp3Wmy/75RV6oT6qxxZtVJdW3b9aOOqHvUuxkC87mv7lNH2pJ4Q/2xD4H5/KKuGLbERvVqgxL/ckXdOCyJ5QOS6JRZPmiJV6wOgUHzs4M8Z6xO7GGxN6e28H1EXQlcBJbk/gCF3AfeTildioQXZTS8i+FJALwM7IyGQyOijgLTwGhhUaXMAitSSnd7BaMjsoU8iXvAAWBTvd9o/Xm83hZlCfBxRr476pcZJ+mU+m6XtsbqTJRDTYqcCnY6101insxcsM0TTYpcD3b6RUab48E2Z5oUuRfs9L2MNjcF25yLtBc92Q3mfg/mAM4Hc48joajI7WAuh0b7jjZ2K5jbEMzlZG9GQlGRi8Hcp8EcwCfB3J+RUFQkejxvU8d6herMtib7joqcC+ZGgKPdZOptR6nmUhHOBHO9UZepj4KXS+vL9Xh9iR2t/96vv4teylUfqK9FasyZxp+lWuIZJsdTSh9EgjnT+G8Li+mHb6LBnBFZD/xRVE4ZAmtSSlci4fCIpJQuAGdLqyrgp6gE5B1aAJOZ+X6YyAlnrf1aPSlOAUtz9itgGngrpfQgukPWiNSPnIdzqyrgYI4EFKzGq6uAv6hufoPgb6rRyJqo5p4jpJSmgCO5+2UwnisBhe9H1DepJnNNLw/dBNallEIz3k6yRwQgpXQN2F+ybw92l0j0hbrYZhezL6gvDVWiQ+azBkU2tyJRiyxSTzcg8X1rEh0yY1avz0qZVde17QGAurcPke1t1/8Eq5ei5wskTqovtF3/U1g9DT7MkJhT32m77gVRP88Q2dF2vf+J+qJ6PCBxTC26GQ8NdZV6o4vEjNVrvGcfdav6eAGJh+pHbdeXhbp7AZHwO8FnBjWpX3VIfK02+t9IQ8NqYe6E+qvVY/L/9OIfE3CKlaPsSH4AAAAASUVORK5CYII="/>
|
|
8
|
+
</defs>
|
|
9
|
+
</svg>
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
|
+
<svg id="Icon" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" width="30" height="30">
|
|
3
|
+
<path fill="#00f"
|
|
4
|
+
d="m256,64c-69.37,0-125.8,56.43-125.8,125.8,0,1.44.04,2.95.12,4.62.46,12.87,2.86,25.46,7.1,37.44,24.76,81.02,105.75,183.3,109.19,187.62,2.28,2.86,5.73,4.52,9.39,4.52s7.11-1.67,9.39-4.52c3.44-4.32,84.44-106.59,109.2-187.62,4.25-11.99,6.64-24.57,7.1-37.41.08-1.51.12-3.07.12-4.64,0-69.37-56.44-125.8-125.81-125.8Z" />
|
|
5
|
+
<path fill="#f0f"
|
|
6
|
+
d="m255.99,277.81c-48.59,0-87.99-39.4-87.99-88.01s39.4-87.99,87.99-87.99,88.01,39.41,88.01,87.99-39.39,88.01-88.01,88.01Z" />
|
|
7
|
+
</svg>
|
package/components/si-map/components/si-map-popover/si-map-popover-cluster-template.directive.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MapPointMetaData } from '../../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SiMapPopoverClusterTemplateDirective {
|
|
4
|
+
static ngTemplateContextGuard(directive: SiMapPopoverClusterTemplateDirective, context: unknown): context is {
|
|
5
|
+
mapPoints: MapPointMetaData[];
|
|
6
|
+
};
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiMapPopoverClusterTemplateDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SiMapPopoverClusterTemplateDirective, "[siMapPopoverClusterTemplate]", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { MapPointMetaData } from '../../models';
|
|
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
export declare class SiMapPopoverTemplateDirective {
|
|
4
|
+
static ngTemplateContextGuard(directive: SiMapPopoverTemplateDirective, context: unknown): context is {
|
|
5
|
+
mapPoint: MapPointMetaData;
|
|
6
|
+
};
|
|
7
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiMapPopoverTemplateDirective, never>;
|
|
8
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<SiMapPopoverTemplateDirective, "[siMapPopoverTemplate]", never, {}, {}, never, never, true, never>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { TemplateRef, Type, ViewContainerRef } from '@angular/core';
|
|
6
|
+
import Map from 'ol/Map';
|
|
7
|
+
import { MapPointMetaData } from '../../models/map-point.interface';
|
|
8
|
+
import * as i0 from "@angular/core";
|
|
9
|
+
export interface RenderOptions {
|
|
10
|
+
component?: Type<any>;
|
|
11
|
+
mapPoints: MapPointMetaData | MapPointMetaData[];
|
|
12
|
+
map?: Map;
|
|
13
|
+
}
|
|
14
|
+
export declare class SiMapPopoverComponent {
|
|
15
|
+
private readonly elementRef;
|
|
16
|
+
protected readonly maxHeight: import("@angular/core").WritableSignal<number | null>;
|
|
17
|
+
protected readonly contentContainer: import("@angular/core").Signal<ViewContainerRef>;
|
|
18
|
+
protected readonly defaultContent: import("@angular/core").Signal<TemplateRef<any>>;
|
|
19
|
+
protected readonly defaultCluster: import("@angular/core").Signal<TemplateRef<any>>;
|
|
20
|
+
render({ component, mapPoints, map }: RenderOptions): void;
|
|
21
|
+
private renderCustomComponent;
|
|
22
|
+
private renderDefault;
|
|
23
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiMapPopoverComponent, never>;
|
|
24
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SiMapPopoverComponent, "si-map-popover", never, {}, {}, never, never, true, never>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ElementRef } from '@angular/core';
|
|
6
|
+
import * as i0 from "@angular/core";
|
|
7
|
+
export declare class SiMapTooltipComponent {
|
|
8
|
+
protected readonly content: import("@angular/core").Signal<ElementRef<any>>;
|
|
9
|
+
/**
|
|
10
|
+
* Cutoff text for tooltips, when cluster combines more than 4 features
|
|
11
|
+
*
|
|
12
|
+
* @defaultValue
|
|
13
|
+
* ```
|
|
14
|
+
* $localize`:@@SI_MAPS.TOOLTIP_MORE_TEXT:and {{length}} more...`
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
readonly moreText: import("@angular/core").InputSignal<import("@siemens/element-translate-ng/translate").TranslatableString>;
|
|
18
|
+
/**
|
|
19
|
+
* Adds the maximum length of a string thats allowed in a tooltip and if its longer it cuts off the rest and adds 3 dots at the end.
|
|
20
|
+
* If set to -1, it will not cut off the string.
|
|
21
|
+
* @defaultValue 50
|
|
22
|
+
*/
|
|
23
|
+
readonly maxLabelLength: import("@angular/core").InputSignal<number>;
|
|
24
|
+
get nativeElement(): HTMLElement;
|
|
25
|
+
protected readonly hiddenEntries: import("@angular/core").WritableSignal<number>;
|
|
26
|
+
private readonly elementRef;
|
|
27
|
+
/**
|
|
28
|
+
* Method sets tooltip content. If parameter is of type
|
|
29
|
+
* string, it will directly set it as tooltip content.
|
|
30
|
+
* If it is array of string, it will render it as list of those strings.
|
|
31
|
+
*
|
|
32
|
+
* @param labels - array of strings or string itself
|
|
33
|
+
*/
|
|
34
|
+
setTooltip(labels: string[] | string): void;
|
|
35
|
+
private getLabelSnippet;
|
|
36
|
+
private setContent;
|
|
37
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<SiMapTooltipComponent, never>;
|
|
38
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<SiMapTooltipComponent, "si-map-tooltip", never, { "moreText": { "alias": "moreText"; "required": false; "isSignal": true; }; "maxLabelLength": { "alias": "maxLabelLength"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
39
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export * from './components/index';
|
|
6
|
+
export * from './models/index';
|
|
7
|
+
export * from './services/map.service';
|
|
8
|
+
export * from './si-map.module';
|
|
9
|
+
export * from './si-map.component';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
/** */
|
|
6
|
+
export declare const DEFAULT_STROKE_WEIGHT = 2;
|
|
7
|
+
export declare const DEFAULT_CLUSTER_TYPE = "donut";
|
|
8
|
+
export declare const DEFAULT_DONUT_RATIO = 0.6;
|
|
9
|
+
export declare const ANIMATION_DURATION = 500;
|
|
10
|
+
export declare const DEFAULT_ICON = "assets/default-marker-icon.svg";
|
|
11
|
+
export declare const DEFAULT_ICON_SCALE = 1;
|
|
12
|
+
export declare const SIEMENS_FONT = "bold 13px \"Siemens sans\"";
|
|
13
|
+
export declare const SIEMENS_FONT_LABELS = "700 14px \"Siemens sans\"";
|
|
14
|
+
export declare const DEFAULT_OFFSET = 14;
|
|
15
|
+
export declare const DEFAULT_FEATURE_SELECT_ZOOM = 10;
|
|
16
|
+
export declare const DEFAULT_FEATURE_CLICK_ZOOM = 15;
|
|
17
|
+
export declare const DEFAULT_CLUSTER_CLICK_ZOOM = 15;
|
|
18
|
+
export declare const DEFAULT_GLOBAL_ZOOM = 5;
|
|
19
|
+
export declare const DEFAULT_CLUSTER_DISTANCE = 40;
|
|
20
|
+
/** @deprecated will be removed in favour of individual inputs. */
|
|
21
|
+
export declare const DEFAULT_FIT_PADDING: number[];
|
|
22
|
+
/** Updates the amount of buildings to be shown in a cluster tooltip after hovering over it */
|
|
23
|
+
export declare const TOOLTIP_FEATURES_TO_DISPLAY = 4;
|
|
24
|
+
/** Specifies the maximum amount of buildings allowed to be displayed as a number in a cluster */
|
|
25
|
+
export declare const MAX_CLUSTER_BUILDINGS = 99;
|
|
26
|
+
/** Defines the cluster radius size, so all the clusters are of the same size */
|
|
27
|
+
export declare const CLUSTER_RADIUS_SIZE = 20;
|
|
28
|
+
/** Chart inside the cluster is internally divided into 20 fragments */
|
|
29
|
+
export declare const CLUSTER_CHARTS_FRAGMENTS = 20;
|
|
30
|
+
export declare const GEOJSON_LAYER = "geojson-layer";
|
|
31
|
+
export declare const POINTS_LAYER = "points-layer";
|
|
32
|
+
export declare const LAYER_NAME = "layerName";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ColorPalette } from './color-palette.type';
|
|
2
|
+
/**
|
|
3
|
+
* Class for grouping functionality
|
|
4
|
+
*/
|
|
5
|
+
export declare class Grouping {
|
|
6
|
+
private readonly _colors;
|
|
7
|
+
private readonly _palette?;
|
|
8
|
+
constructor(groupColors?: Record<number, string> | ColorPalette);
|
|
9
|
+
get colors(): string[];
|
|
10
|
+
get palette(): string | undefined;
|
|
11
|
+
get length(): number;
|
|
12
|
+
getColor(groupId: number): string;
|
|
13
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
export * from './constants';
|
|
6
|
+
export * from './color-palette.type';
|
|
7
|
+
export * from './grouping.model';
|
|
8
|
+
export * from './overlay-native-properties.interface';
|
|
9
|
+
export * from './map-point.interface';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
/** */
|
|
6
|
+
export interface MapPoint extends MapPointMetaData {
|
|
7
|
+
/**
|
|
8
|
+
* Latitude value for marker
|
|
9
|
+
*/
|
|
10
|
+
lat: number;
|
|
11
|
+
/**
|
|
12
|
+
* Longtitude value for marker
|
|
13
|
+
*/
|
|
14
|
+
lon: number;
|
|
15
|
+
}
|
|
16
|
+
export interface MapPointMetaData {
|
|
17
|
+
/**
|
|
18
|
+
* Marker name
|
|
19
|
+
*/
|
|
20
|
+
name: string;
|
|
21
|
+
/**
|
|
22
|
+
* Marker description, can be simple string or HTML as string
|
|
23
|
+
*/
|
|
24
|
+
description: string;
|
|
25
|
+
/**
|
|
26
|
+
* Marker style
|
|
27
|
+
*/
|
|
28
|
+
marker?: MarkerOptions;
|
|
29
|
+
/**
|
|
30
|
+
* Extra properties to be passed along (click function consumes it)
|
|
31
|
+
*/
|
|
32
|
+
extraProperties?: any;
|
|
33
|
+
/**
|
|
34
|
+
* If you want your point to be clustered by it's group, you need to set the group id here for this point
|
|
35
|
+
* Color with the same id will be assigned. Must be higher than 0
|
|
36
|
+
*/
|
|
37
|
+
group?: number;
|
|
38
|
+
/**
|
|
39
|
+
* Click functionality, do any extra staff when clicking on the point, just create needed logic for click functionality
|
|
40
|
+
*/
|
|
41
|
+
click?(extraProperties?: any): void;
|
|
42
|
+
}
|
|
43
|
+
export type MarkerStatusType = 'success' | 'info' | 'warning' | 'danger' | 'caution' | 'critical' | 'default' | 'unknown';
|
|
44
|
+
export interface LabelOptions {
|
|
45
|
+
/**
|
|
46
|
+
* Text to display as label
|
|
47
|
+
*/
|
|
48
|
+
text: string;
|
|
49
|
+
}
|
|
50
|
+
export interface MarkerOptions {
|
|
51
|
+
/**
|
|
52
|
+
* Visual representation of marker
|
|
53
|
+
*/
|
|
54
|
+
type: 'icon' | 'dot' | 'status';
|
|
55
|
+
/**
|
|
56
|
+
* Color of the marker, HEX or css compliant color value. Only use when a semantic status
|
|
57
|
+
* isn't working for the use-case.
|
|
58
|
+
*/
|
|
59
|
+
color?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Semantic status for coloring. This is also theme-aware.
|
|
62
|
+
*/
|
|
63
|
+
status?: MarkerStatusType;
|
|
64
|
+
/**
|
|
65
|
+
* Icon options
|
|
66
|
+
*/
|
|
67
|
+
icon?: IconMarkerOptions;
|
|
68
|
+
}
|
|
69
|
+
export interface IconMarkerOptions {
|
|
70
|
+
/**
|
|
71
|
+
* Path to the icon image
|
|
72
|
+
*/
|
|
73
|
+
src?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Scale value for marker
|
|
76
|
+
*/
|
|
77
|
+
scale?: number;
|
|
78
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import Control from 'ol/control/Control';
|
|
6
|
+
import Overlay from 'ol/Overlay';
|
|
7
|
+
export interface OverlayNativeProperties {
|
|
8
|
+
/**
|
|
9
|
+
* Layer for popup element, an element to be displayed over the map and attached to a single map location.
|
|
10
|
+
*/
|
|
11
|
+
overlay?: Overlay;
|
|
12
|
+
/**
|
|
13
|
+
* List of controls to activate for map, additional controls like full screen, etc. can be added here
|
|
14
|
+
* Defaults are zoom in and out
|
|
15
|
+
*/
|
|
16
|
+
controls?: Control[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import Feature from 'ol/Feature';
|
|
2
|
+
import Select, { SelectEvent } from 'ol/interaction/Select';
|
|
3
|
+
import { StyleLike } from 'ol/style/Style';
|
|
4
|
+
export declare class SelectCluster extends Select {
|
|
5
|
+
private zoomOnClick;
|
|
6
|
+
private maxZoom;
|
|
7
|
+
private fitClusterPadding;
|
|
8
|
+
constructor(options: {
|
|
9
|
+
fitClusterPadding: () => number[];
|
|
10
|
+
maxZoom: () => number;
|
|
11
|
+
style?: StyleLike | null;
|
|
12
|
+
zoomOnClick: () => boolean;
|
|
13
|
+
});
|
|
14
|
+
selectCluster(e: SelectEvent): void;
|
|
15
|
+
zoomToCluster(cluster: Feature[]): void;
|
|
16
|
+
}
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import Feature from 'ol/Feature';
|
|
2
|
+
import Point from 'ol/geom/Point';
|
|
3
|
+
import Layer from 'ol/layer/Layer';
|
|
4
|
+
import VectorLayer from 'ol/layer/Vector';
|
|
5
|
+
import Cluster from 'ol/source/Cluster';
|
|
6
|
+
import VectorSource from 'ol/source/Vector';
|
|
7
|
+
import { Style } from 'ol/style';
|
|
8
|
+
import { ColorPalette } from '../models/color-palette.type';
|
|
9
|
+
import { MapPoint } from '../models/map-point.interface';
|
|
10
|
+
import { ThemeType } from '../shared/themes/element';
|
|
11
|
+
import * as i0 from "@angular/core";
|
|
12
|
+
export declare class MapService {
|
|
13
|
+
private styleCache;
|
|
14
|
+
private clusterStyleCache;
|
|
15
|
+
private labelStyleCache;
|
|
16
|
+
private grouping?;
|
|
17
|
+
private _theme?;
|
|
18
|
+
private wrappedTextCache;
|
|
19
|
+
private labelTextStyleCache;
|
|
20
|
+
resetCaches(): void;
|
|
21
|
+
private wrapLabelText;
|
|
22
|
+
private getLabelTextStyle;
|
|
23
|
+
private zoomCallback;
|
|
24
|
+
private getZoom;
|
|
25
|
+
setZoomCallback(callback?: () => number | undefined): void;
|
|
26
|
+
setTheme(groupColors: Record<number, string> | ColorPalette | undefined): void;
|
|
27
|
+
get theme(): ThemeType;
|
|
28
|
+
/**
|
|
29
|
+
* Create feature with parameters
|
|
30
|
+
* @param points - the list of points
|
|
31
|
+
*/
|
|
32
|
+
createFeatures(points: MapPoint[], alwaysShowLabels?: boolean): Feature[];
|
|
33
|
+
/**
|
|
34
|
+
* Initialize animated cluster layer for points if clustering is enabled
|
|
35
|
+
* @param features - for the source
|
|
36
|
+
* @param markerAnimation - animation value for markers
|
|
37
|
+
* @param clusterDistance - number distance between clusters
|
|
38
|
+
* @param multiWorld - boolean if points should be repeated on multiple world maps
|
|
39
|
+
*/
|
|
40
|
+
clusterLayer(features: Feature[], markerAnimation: boolean, clusterDistance: number, multiWorld: boolean): Layer;
|
|
41
|
+
/**
|
|
42
|
+
* Create vector layer when clustering is disabled
|
|
43
|
+
* @param features - list of Features
|
|
44
|
+
* @param multiWorld - boolean if points should be repeated on multiple world maps
|
|
45
|
+
*/
|
|
46
|
+
vectorLayer(features: Feature[], multiWorld: boolean, defaultStyle?: boolean): VectorLayer<VectorSource>;
|
|
47
|
+
labelLayer(features: Feature[], multiWorld: boolean, maxLabelLength: number, maxLines: number, clusterLayer?: Layer): VectorLayer<VectorSource>;
|
|
48
|
+
/**
|
|
49
|
+
* Cluster styling
|
|
50
|
+
*
|
|
51
|
+
* @param feature - Feature
|
|
52
|
+
*/
|
|
53
|
+
getClusterStyle(feature: Feature): Style[];
|
|
54
|
+
/**
|
|
55
|
+
* Separate feature styling with icon
|
|
56
|
+
* @param feature - to style
|
|
57
|
+
* @param cluster - indication
|
|
58
|
+
* @param grouping - colors
|
|
59
|
+
*/
|
|
60
|
+
getFeatureStyle(feature: Feature, cluster: boolean, features: Feature[], dummy?: boolean): Style[];
|
|
61
|
+
getLabelStyle(feature: Feature<Point>, features: Feature<Point>[], maxLabelLength: number, maxLines: number, clusterSource?: Cluster<Feature<Point>>, dummy?: boolean): Style[];
|
|
62
|
+
getMarkerOffset(feature: Feature): [number, number];
|
|
63
|
+
getMarkerSize(feature: Feature): [number, number];
|
|
64
|
+
private getClusterChart;
|
|
65
|
+
private getClusterChartData;
|
|
66
|
+
/**
|
|
67
|
+
* Calculates minimal safe distance for clustering to avoid overlapping of clusters
|
|
68
|
+
*/
|
|
69
|
+
private calculateClusteringDistance;
|
|
70
|
+
private transformChartData;
|
|
71
|
+
private getMarkerStyle;
|
|
72
|
+
/**
|
|
73
|
+
* Decides what color should Marker be painted with.
|
|
74
|
+
*
|
|
75
|
+
* Markers are painted with group colors if group id is present. If marker color is specified,
|
|
76
|
+
* it takes precedence over the group color.
|
|
77
|
+
*/
|
|
78
|
+
private getMarkerColor;
|
|
79
|
+
private getDotMarker;
|
|
80
|
+
private getIconMarker;
|
|
81
|
+
private getStatusMarkerColor;
|
|
82
|
+
private getStatusMarker;
|
|
83
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<MapService, never>;
|
|
84
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<MapService>;
|
|
85
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { ColorPalettes } from '../../models/color-palette.type';
|
|
6
|
+
import { MarkerStatusType } from '../../models/map-point.interface';
|
|
7
|
+
export declare const themeElement: {
|
|
8
|
+
style: () => {
|
|
9
|
+
fillColor: string;
|
|
10
|
+
strokeColor: string;
|
|
11
|
+
textColor: string;
|
|
12
|
+
defaultMarkerColor: string;
|
|
13
|
+
status: Record<MarkerStatusType, string>;
|
|
14
|
+
colorPalette: ColorPalettes;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export type ThemeType = ReturnType<typeof themeElement.style>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) Siemens 2016 - 2025
|
|
3
|
+
* SPDX-License-Identifier: MIT
|
|
4
|
+
*/
|
|
5
|
+
import { MarkerStatusType } from '../../models/map-point.interface';
|
|
6
|
+
import { ThemeType } from './element';
|
|
7
|
+
export declare const getMarker: (status: MarkerStatusType, theme: ThemeType) => string;
|