@artstesh/maps 5.1.1 → 5.1.3
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/dist/esm2022/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +47 -1
- package/dist/esm2022/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2022/map/messages/commands/add-control.command.mjs +13 -0
- package/dist/esm2022/map/messages/commands/remove-control.command.mjs +13 -0
- package/dist/esm2022/map/messages/commands/set-map-center.command.mjs +26 -0
- package/dist/esm2022/map/messages/index.mjs +4 -1
- package/dist/esm2022/map/models/index.mjs +2 -1
- package/dist/esm2022/map/models/map-control.mjs +15 -0
- package/dist/esm2022/map/services/controls/controls.service.mjs +39 -0
- package/dist/esm2022/map/services/map-management.service.mjs +2 -2
- package/dist/esm2022/map/services/map-state.service.mjs +19 -4
- package/dist/esm2022/map/services/message-registrator.service.mjs +12 -5
- package/dist/esm2022/src/map/map-plate/features/markers/markers.component.mjs +3 -3
- package/dist/esm2022/src/map/map-plate/features/polygons/polygons.component.mjs +2 -2
- package/dist/esm2022/src/map/map-plate/layers/feature-layer/feature-layer.settings.mjs +47 -1
- package/dist/esm2022/src/map/map-plate/map-plate.component.mjs +4 -1
- package/dist/esm2022/src/map/messages/commands/add-control.command.mjs +13 -0
- package/dist/esm2022/src/map/messages/commands/remove-control.command.mjs +13 -0
- package/dist/esm2022/src/map/messages/commands/set-map-center.command.mjs +26 -0
- package/dist/esm2022/src/map/messages/index.mjs +4 -1
- package/dist/esm2022/src/map/models/index.mjs +2 -1
- package/dist/esm2022/src/map/models/map-control.mjs +15 -0
- package/dist/esm2022/src/map/services/controls/controls.service.mjs +39 -0
- package/dist/esm2022/src/map/services/map-management.service.mjs +2 -2
- package/dist/esm2022/src/map/services/map-state.service.mjs +19 -4
- package/dist/esm2022/src/map/services/message-registrator.service.mjs +12 -5
- package/dist/fesm2022/maps-components-src-map.mjs +173 -11
- package/dist/fesm2022/maps-components-src-map.mjs.map +1 -1
- package/dist/fesm2022/maps-components.mjs +173 -11
- package/dist/fesm2022/maps-components.mjs.map +1 -1
- package/dist/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/dist/map/messages/commands/add-control.command.d.ts +8 -0
- package/dist/map/messages/commands/remove-control.command.d.ts +8 -0
- package/dist/map/messages/commands/set-map-center.command.d.ts +18 -0
- package/dist/map/messages/index.d.ts +3 -0
- package/dist/map/models/index.d.ts +1 -0
- package/dist/map/models/map-control.d.ts +13 -0
- package/dist/map/services/controls/controls.service.d.ts +14 -0
- package/dist/map/services/map-state.service.d.ts +2 -0
- package/dist/map/services/message-registrator.service.d.ts +2 -1
- package/dist/src/map/map-plate/layers/feature-layer/feature-layer.settings.d.ts +46 -0
- package/dist/src/map/messages/commands/add-control.command.d.ts +8 -0
- package/dist/src/map/messages/commands/remove-control.command.d.ts +8 -0
- package/dist/src/map/messages/commands/set-map-center.command.d.ts +18 -0
- package/dist/src/map/messages/index.d.ts +3 -0
- package/dist/src/map/models/index.d.ts +1 -0
- package/dist/src/map/models/map-control.d.ts +13 -0
- package/dist/src/map/services/controls/controls.service.d.ts +14 -0
- package/dist/src/map/services/map-state.service.d.ts +2 -0
- package/dist/src/map/services/message-registrator.service.d.ts +2 -1
- package/package.json +1 -1
|
@@ -1,15 +1,61 @@
|
|
|
1
1
|
import Style, { StyleFunction } from 'ol/style/Style';
|
|
2
|
+
/**
|
|
3
|
+
* A layer that is responsible for showing and styling main features on the map, such as markers and polygons
|
|
4
|
+
*/
|
|
2
5
|
export declare class FeatureLayerSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The identifier of the field, it is autogenerated by default, but can be set manually
|
|
8
|
+
*/
|
|
3
9
|
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The priority of showing - layers with higher zIndex cover others in case of collisions
|
|
12
|
+
*/
|
|
4
13
|
zIndex: number;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum zoom at which the layer is visible. 19 by default
|
|
16
|
+
*/
|
|
5
17
|
maxZoom: number;
|
|
18
|
+
/**
|
|
19
|
+
* The minimum zoom at which the layer is visible. 0 by default
|
|
20
|
+
*/
|
|
6
21
|
minZoom: number;
|
|
22
|
+
/**
|
|
23
|
+
* The styling definition of layer's features. The easiest way is to use {@link PolygonStyleHelper},{@link MarkerStyleHelper}
|
|
24
|
+
*/
|
|
7
25
|
style?: Style | StyleFunction;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a clone of the existing settings
|
|
28
|
+
* @param model
|
|
29
|
+
*/
|
|
8
30
|
static copy(model: FeatureLayerSettings): FeatureLayerSettings;
|
|
31
|
+
/**
|
|
32
|
+
Setter for {@link FeatureLayerSettings.zIndex}
|
|
33
|
+
* @param zIndex
|
|
34
|
+
*/
|
|
9
35
|
setZIndex(zIndex: number): FeatureLayerSettings;
|
|
36
|
+
/**
|
|
37
|
+
* Setter for {@link FeatureLayerSettings.name}
|
|
38
|
+
* @param name
|
|
39
|
+
*/
|
|
10
40
|
setName(name: string): FeatureLayerSettings;
|
|
41
|
+
/**
|
|
42
|
+
* Setter for {@link FeatureLayerSettings.maxZoom}
|
|
43
|
+
* @param maxZoom
|
|
44
|
+
*/
|
|
11
45
|
setMaxZoom(maxZoom: number): FeatureLayerSettings;
|
|
46
|
+
/**
|
|
47
|
+
* Setter for {@link FeatureLayerSettings.minZoom}
|
|
48
|
+
* @param minZoom
|
|
49
|
+
*/
|
|
12
50
|
setMinZoom(minZoom: number): FeatureLayerSettings;
|
|
51
|
+
/**
|
|
52
|
+
* Setter for {@link FeatureLayerSettings.style}
|
|
53
|
+
* @param style
|
|
54
|
+
*/
|
|
13
55
|
setStyle(style: Style | StyleFunction): FeatureLayerSettings;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the model has the same content
|
|
58
|
+
* @param model - the object to compare
|
|
59
|
+
*/
|
|
14
60
|
isSame(model: FeatureLayerSettings): boolean;
|
|
15
61
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
import { MapControl } from '../../models/map-control';
|
|
3
|
+
export declare class AddControlCommand extends PostboyGenericMessage {
|
|
4
|
+
item: MapControl;
|
|
5
|
+
static readonly ID: string;
|
|
6
|
+
constructor(item: MapControl);
|
|
7
|
+
get id(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
import { MapControl } from '../../models/map-control';
|
|
3
|
+
export declare class RemoveControlCommand extends PostboyGenericMessage {
|
|
4
|
+
item: MapControl;
|
|
5
|
+
static readonly ID: string;
|
|
6
|
+
constructor(item: MapControl);
|
|
7
|
+
get id(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
/**
|
|
3
|
+
* Forces map to move to a specific point
|
|
4
|
+
*/
|
|
5
|
+
export declare class SetMapCenterCommand extends PostboyGenericMessage {
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
zoom?: number | undefined;
|
|
9
|
+
static readonly ID: string;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param lat - the desired latitude
|
|
13
|
+
* @param lng - the desired longitude
|
|
14
|
+
* @param zoom - the desired zoom; doesn't change zoom if undefined
|
|
15
|
+
*/
|
|
16
|
+
constructor(lat: number, lng: number, zoom?: number | undefined);
|
|
17
|
+
get id(): string;
|
|
18
|
+
}
|
|
@@ -7,3 +7,6 @@ export * from './commands/cancel-drawing.command';
|
|
|
7
7
|
export * from './commands/draw-selection-area.command';
|
|
8
8
|
export * from './commands/modify-feature.command';
|
|
9
9
|
export * from './commands/cancel-feature-modification.command';
|
|
10
|
+
export * from './commands/add-control.command';
|
|
11
|
+
export * from './commands/remove-control.command';
|
|
12
|
+
export * from './commands/set-map-center.command';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control } from 'ol/control';
|
|
2
|
+
import { Options } from 'ol/control/Control';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
6
|
+
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
7
|
+
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
8
|
+
* The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
|
|
9
|
+
* You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MapControl extends Control {
|
|
12
|
+
constructor(options: Options);
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MapPostboyService } from '../map-postboy.service';
|
|
2
|
+
import { IPostboyDependingService } from '@artstesh/postboy';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ControlsService implements IPostboyDependingService {
|
|
5
|
+
private postboy;
|
|
6
|
+
private map?;
|
|
7
|
+
constructor(postboy: MapPostboyService);
|
|
8
|
+
up(): void;
|
|
9
|
+
private observeMapRender;
|
|
10
|
+
private observeAdding;
|
|
11
|
+
private observeRemoving;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ControlsService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ControlsService>;
|
|
14
|
+
}
|
|
@@ -6,6 +6,8 @@ export declare class MapStateService implements IPostboyDependingService {
|
|
|
6
6
|
private map?;
|
|
7
7
|
constructor(postboy: MapPostboyService);
|
|
8
8
|
up(): void;
|
|
9
|
+
private observeMapRendering;
|
|
10
|
+
private observeCenter;
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
|
|
10
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<MapStateService>;
|
|
11
13
|
}
|
|
@@ -6,9 +6,10 @@ import { MapClickService } from './map-click.service';
|
|
|
6
6
|
import { MapFeatureService } from './map-feature.service';
|
|
7
7
|
import { DrawingService } from './drawing/drawing.service';
|
|
8
8
|
import { FeatureModificationService } from './drawing/feature-modification.service';
|
|
9
|
+
import { ControlsService } from './controls/controls.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
11
|
-
constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService);
|
|
12
|
+
constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
|
|
12
13
|
protected _up(): void;
|
|
13
14
|
private setExecutors;
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageRegistratorService, never>;
|
|
@@ -1,15 +1,61 @@
|
|
|
1
1
|
import Style, { StyleFunction } from 'ol/style/Style';
|
|
2
|
+
/**
|
|
3
|
+
* A layer that is responsible for showing and styling main features on the map, such as markers and polygons
|
|
4
|
+
*/
|
|
2
5
|
export declare class FeatureLayerSettings {
|
|
6
|
+
/**
|
|
7
|
+
* The identifier of the field, it is autogenerated by default, but can be set manually
|
|
8
|
+
*/
|
|
3
9
|
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* The priority of showing - layers with higher zIndex cover others in case of collisions
|
|
12
|
+
*/
|
|
4
13
|
zIndex: number;
|
|
14
|
+
/**
|
|
15
|
+
* The maximum zoom at which the layer is visible. 19 by default
|
|
16
|
+
*/
|
|
5
17
|
maxZoom: number;
|
|
18
|
+
/**
|
|
19
|
+
* The minimum zoom at which the layer is visible. 0 by default
|
|
20
|
+
*/
|
|
6
21
|
minZoom: number;
|
|
22
|
+
/**
|
|
23
|
+
* The styling definition of layer's features. The easiest way is to use {@link PolygonStyleHelper},{@link MarkerStyleHelper}
|
|
24
|
+
*/
|
|
7
25
|
style?: Style | StyleFunction;
|
|
26
|
+
/**
|
|
27
|
+
* Creates a clone of the existing settings
|
|
28
|
+
* @param model
|
|
29
|
+
*/
|
|
8
30
|
static copy(model: FeatureLayerSettings): FeatureLayerSettings;
|
|
31
|
+
/**
|
|
32
|
+
Setter for {@link FeatureLayerSettings.zIndex}
|
|
33
|
+
* @param zIndex
|
|
34
|
+
*/
|
|
9
35
|
setZIndex(zIndex: number): FeatureLayerSettings;
|
|
36
|
+
/**
|
|
37
|
+
* Setter for {@link FeatureLayerSettings.name}
|
|
38
|
+
* @param name
|
|
39
|
+
*/
|
|
10
40
|
setName(name: string): FeatureLayerSettings;
|
|
41
|
+
/**
|
|
42
|
+
* Setter for {@link FeatureLayerSettings.maxZoom}
|
|
43
|
+
* @param maxZoom
|
|
44
|
+
*/
|
|
11
45
|
setMaxZoom(maxZoom: number): FeatureLayerSettings;
|
|
46
|
+
/**
|
|
47
|
+
* Setter for {@link FeatureLayerSettings.minZoom}
|
|
48
|
+
* @param minZoom
|
|
49
|
+
*/
|
|
12
50
|
setMinZoom(minZoom: number): FeatureLayerSettings;
|
|
51
|
+
/**
|
|
52
|
+
* Setter for {@link FeatureLayerSettings.style}
|
|
53
|
+
* @param style
|
|
54
|
+
*/
|
|
13
55
|
setStyle(style: Style | StyleFunction): FeatureLayerSettings;
|
|
56
|
+
/**
|
|
57
|
+
* Checks if the model has the same content
|
|
58
|
+
* @param model - the object to compare
|
|
59
|
+
*/
|
|
14
60
|
isSame(model: FeatureLayerSettings): boolean;
|
|
15
61
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
import { MapControl } from '../../models/map-control';
|
|
3
|
+
export declare class AddControlCommand extends PostboyGenericMessage {
|
|
4
|
+
item: MapControl;
|
|
5
|
+
static readonly ID: string;
|
|
6
|
+
constructor(item: MapControl);
|
|
7
|
+
get id(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
import { MapControl } from '../../models/map-control';
|
|
3
|
+
export declare class RemoveControlCommand extends PostboyGenericMessage {
|
|
4
|
+
item: MapControl;
|
|
5
|
+
static readonly ID: string;
|
|
6
|
+
constructor(item: MapControl);
|
|
7
|
+
get id(): string;
|
|
8
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { PostboyGenericMessage } from '@artstesh/postboy';
|
|
2
|
+
/**
|
|
3
|
+
* Forces map to move to a specific point
|
|
4
|
+
*/
|
|
5
|
+
export declare class SetMapCenterCommand extends PostboyGenericMessage {
|
|
6
|
+
lat: number;
|
|
7
|
+
lng: number;
|
|
8
|
+
zoom?: number | undefined;
|
|
9
|
+
static readonly ID: string;
|
|
10
|
+
/**
|
|
11
|
+
*
|
|
12
|
+
* @param lat - the desired latitude
|
|
13
|
+
* @param lng - the desired longitude
|
|
14
|
+
* @param zoom - the desired zoom; doesn't change zoom if undefined
|
|
15
|
+
*/
|
|
16
|
+
constructor(lat: number, lng: number, zoom?: number | undefined);
|
|
17
|
+
get id(): string;
|
|
18
|
+
}
|
|
@@ -7,3 +7,6 @@ export * from './commands/cancel-drawing.command';
|
|
|
7
7
|
export * from './commands/draw-selection-area.command';
|
|
8
8
|
export * from './commands/modify-feature.command';
|
|
9
9
|
export * from './commands/cancel-feature-modification.command';
|
|
10
|
+
export * from './commands/add-control.command';
|
|
11
|
+
export * from './commands/remove-control.command';
|
|
12
|
+
export * from './commands/set-map-center.command';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Control } from 'ol/control';
|
|
2
|
+
import { Options } from 'ol/control/Control';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* A control is a visible widget with a DOM element in a fixed position on the screen. They can involve user input (buttons), or be informational only; the position is determined using CSS. By default these are placed in the container with CSS class name ol-overlaycontainer-stopevent, but can use any outside DOM element.
|
|
6
|
+
* This is the base class for controls. You can use it for simple custom controls by creating the element with listeners, creating an instance:
|
|
7
|
+
* var myControl = new Control({element: myElement}); and then adding this to the map.
|
|
8
|
+
* The main advantage of having this as a control rather than a simple separate DOM element is that preventing propagation is handled for you. Controls will also be objects in a module:ol/Collection~Collection, so you can use their methods.
|
|
9
|
+
* You can also extend this base for your own control class. See examples/custom-controls for an example of how to do this.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MapControl extends Control {
|
|
12
|
+
constructor(options: Options);
|
|
13
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { MapPostboyService } from '../map-postboy.service';
|
|
2
|
+
import { IPostboyDependingService } from '@artstesh/postboy';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class ControlsService implements IPostboyDependingService {
|
|
5
|
+
private postboy;
|
|
6
|
+
private map?;
|
|
7
|
+
constructor(postboy: MapPostboyService);
|
|
8
|
+
up(): void;
|
|
9
|
+
private observeMapRender;
|
|
10
|
+
private observeAdding;
|
|
11
|
+
private observeRemoving;
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ControlsService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<ControlsService>;
|
|
14
|
+
}
|
|
@@ -6,6 +6,8 @@ export declare class MapStateService implements IPostboyDependingService {
|
|
|
6
6
|
private map?;
|
|
7
7
|
constructor(postboy: MapPostboyService);
|
|
8
8
|
up(): void;
|
|
9
|
+
private observeMapRendering;
|
|
10
|
+
private observeCenter;
|
|
9
11
|
static ɵfac: i0.ɵɵFactoryDeclaration<MapStateService, never>;
|
|
10
12
|
static ɵprov: i0.ɵɵInjectableDeclaration<MapStateService>;
|
|
11
13
|
}
|
|
@@ -6,9 +6,10 @@ import { MapClickService } from './map-click.service';
|
|
|
6
6
|
import { MapFeatureService } from './map-feature.service';
|
|
7
7
|
import { DrawingService } from './drawing/drawing.service';
|
|
8
8
|
import { FeatureModificationService } from './drawing/feature-modification.service';
|
|
9
|
+
import { ControlsService } from './controls/controls.service';
|
|
9
10
|
import * as i0 from "@angular/core";
|
|
10
11
|
export declare class MessageRegistratorService extends PostboyAbstractRegistrator {
|
|
11
|
-
constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService);
|
|
12
|
+
constructor(service: MapPostboyService, management: MapManagementService, state: MapStateService, mapFeature: MapFeatureService, interaction: MapClickService, drawing: DrawingService, featureModification: FeatureModificationService, controls: ControlsService);
|
|
12
13
|
protected _up(): void;
|
|
13
14
|
private setExecutors;
|
|
14
15
|
static ɵfac: i0.ɵɵFactoryDeclaration<MessageRegistratorService, never>;
|