@mappable-world/mappable-types 0.0.17 → 0.0.18
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/common/types/data-source-description.d.ts +2 -0
- package/common/types/hotspot.d.ts +5 -1
- package/common/types/layer-implementation.d.ts +5 -1
- package/imperative/Entities.d.ts +10 -0
- package/imperative/MMapEnities.d.ts +3 -0
- package/imperative/MMapFeature/index.d.ts +1 -0
- package/imperative/MMapHotspot/index.d.ts +2 -0
- package/imperative/MMapLayer/index.d.ts +1 -0
- package/imperative/MMapMarker/index.d.ts +0 -9
- package/package.json +1 -1
- package/packages/controls/MMapZoomControl/index.d.ts +1 -1
|
@@ -138,6 +138,8 @@ interface VectorTileDataSourceDescription {
|
|
|
138
138
|
allObjectsInteractive?: boolean;
|
|
139
139
|
/** Forces tiles to wait for the icons, disables hiding icons by zoom diff */
|
|
140
140
|
iconsOnlyTiles?: boolean;
|
|
141
|
+
/** Milliseconds */
|
|
142
|
+
cameraIdleThrottling?: number;
|
|
141
143
|
richModelDecoderWorkerUrl?: string;
|
|
142
144
|
customization?: VectorCustomization;
|
|
143
145
|
theme?: MapTheme;
|
|
@@ -10,4 +10,8 @@ interface HotspotObject {
|
|
|
10
10
|
type: 'hotspot';
|
|
11
11
|
feature: HotspotFeature<LngLat>;
|
|
12
12
|
}
|
|
13
|
-
|
|
13
|
+
interface RawHotspotObject {
|
|
14
|
+
type: 'raw-hotspot';
|
|
15
|
+
feature: HotspotFeature<LngLat>;
|
|
16
|
+
}
|
|
17
|
+
export { HotspotFeature, HotspotObject, RawHotspotObject };
|
|
@@ -4,7 +4,7 @@ import type { Vec2 } from "./vec2";
|
|
|
4
4
|
import type { Camera } from "./camera";
|
|
5
5
|
import type { WorldOptions } from "./world-options";
|
|
6
6
|
import type { GenericProjection } from "./projection";
|
|
7
|
-
import type { PixelCoordinates } from "./coordinates";
|
|
7
|
+
import type { PixelCoordinates, WorldCoordinates } from "./coordinates";
|
|
8
8
|
interface WorldOffset {
|
|
9
9
|
readonly left: number;
|
|
10
10
|
readonly top: number;
|
|
@@ -21,6 +21,10 @@ interface RasterLayerImplementationRenderProps extends LayerImplementationRender
|
|
|
21
21
|
interface RasterLayerImplementation {
|
|
22
22
|
destroy(): void;
|
|
23
23
|
render(props: RasterLayerImplementationRenderProps): void;
|
|
24
|
+
findObjectInPosition?(coords: {
|
|
25
|
+
readonly worldCoordinates: WorldCoordinates;
|
|
26
|
+
readonly screenCoordinates: PixelCoordinates;
|
|
27
|
+
}): unknown | undefined | null;
|
|
24
28
|
}
|
|
25
29
|
interface RasterLayerImplementationConstructorProps {
|
|
26
30
|
requestRender: () => void;
|
package/imperative/Entities.d.ts
CHANGED
|
@@ -26,6 +26,7 @@ type WithDefaults<Props, DefaultProps extends Partial<Props>> = Props & {
|
|
|
26
26
|
* name: 'entity'
|
|
27
27
|
* };
|
|
28
28
|
* class MMapSomeEntity extends GenericEntity<MMapSomeEntityProps, typeof defaultProps> {
|
|
29
|
+
* static defaultProps = defaultProps;
|
|
29
30
|
* public isAttached: boolean;
|
|
30
31
|
* constructor(props: MMapSomeEntityProps) {
|
|
31
32
|
* super(props);
|
|
@@ -49,6 +50,12 @@ declare abstract class GenericEntity<Props, DefaultProps extends {} = {}, Root e
|
|
|
49
50
|
* @param props - The value of input props.
|
|
50
51
|
*/
|
|
51
52
|
constructor(props: Props);
|
|
53
|
+
/**
|
|
54
|
+
* The method provides the default values for the properties of an Entity.
|
|
55
|
+
* @param _props - Input props value for the Entity.
|
|
56
|
+
* @returns Props with default values.
|
|
57
|
+
*/
|
|
58
|
+
protected _getDefaultProps(_props: Props): DefaultProps | undefined;
|
|
52
59
|
/**
|
|
53
60
|
* Method for updating props of Entity.
|
|
54
61
|
* @param changedProps - New props values.
|
|
@@ -122,6 +129,7 @@ interface ComplexOptions<Root extends GenericRootEntity<unknown> = GenericRootEn
|
|
|
122
129
|
* name: 'entity'
|
|
123
130
|
* };
|
|
124
131
|
* class MMapSomeComplexEntity extends GenericComplexEntity<MMapSomeComplexEntityProps, typeof defaultProps> {
|
|
132
|
+
* static defaultProps = defaultProps;
|
|
125
133
|
* private _someEntity?: MMapSomeEntity; // MMapSomeEntity extends GenericEntity
|
|
126
134
|
* protected _onAttach(): void {
|
|
127
135
|
* this._someEntity = new MMapSomeEntity();
|
|
@@ -187,6 +195,7 @@ declare class GenericComplexEntity<Props, DefaultProps extends {} = {}, Root ext
|
|
|
187
195
|
* name: 'entity'
|
|
188
196
|
* };
|
|
189
197
|
* class MMapSomeGroupEntity extends GenericGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
|
|
198
|
+
* static defaultProps = defaultProps;
|
|
190
199
|
* // ...
|
|
191
200
|
* }
|
|
192
201
|
* const groupEntity = new MMapSomeGroupEntity()
|
|
@@ -215,6 +224,7 @@ declare class GenericGroupEntity<Props, DefaultProps extends {} = {}, Root exten
|
|
|
215
224
|
* }
|
|
216
225
|
* // Now we can specify their root element for the Entity
|
|
217
226
|
* class MMapSomeEntity extends GenericEntity<MMapSomeEntityProps, typeof defaultProps, MMap> {
|
|
227
|
+
* static defaultProps = defaultProps;
|
|
218
228
|
* // ...
|
|
219
229
|
* }
|
|
220
230
|
*/
|
|
@@ -13,6 +13,7 @@ import { GenericComplexEntity, GenericEntity, GenericGroupEntity, Context } from
|
|
|
13
13
|
* name: 'entity'
|
|
14
14
|
* };
|
|
15
15
|
* class MMapSomeEntity extends MMapEntity<MMapSomeEntityProps, typeof defaultProps> {
|
|
16
|
+
* static defaultProps = defaultProps;
|
|
16
17
|
* public isAttached: boolean;
|
|
17
18
|
* constructor(props: MMapSomeEntityProps) {
|
|
18
19
|
* super(props);
|
|
@@ -45,6 +46,7 @@ declare abstract class MMapEntity<Props, DefaultProps extends {} = {}> extends G
|
|
|
45
46
|
* name: 'entity'
|
|
46
47
|
* };
|
|
47
48
|
* class MMapSomeComplexEntity extends MMapComplexEntity<MMapSomeComplexEntityProps, typeof defaultProps> {
|
|
49
|
+
* static defaultProps = defaultProps;
|
|
48
50
|
* private _someEntity?: MMapSomeEntity; // MMapSomeEntity extends GenericEntity
|
|
49
51
|
* protected _onAttach(): void {
|
|
50
52
|
* this._someEntity = new MMapSomeEntity();
|
|
@@ -73,6 +75,7 @@ declare abstract class MMapComplexEntity<Props, DefaultProps extends {} = {}> ex
|
|
|
73
75
|
* name: 'entity'
|
|
74
76
|
* };
|
|
75
77
|
* class MMapSomeGroupEntity extends MMapGroupEntity<MMapSomeGroupEntityProps, typeof defaultProps> {
|
|
78
|
+
* static defaultProps = defaultProps;
|
|
76
79
|
* // ...
|
|
77
80
|
* }
|
|
78
81
|
* const groupEntity = new MMapSomeGroupEntity()
|
|
@@ -59,6 +59,7 @@ declare class MMapFeature extends MMapEntity<MMapFeatureProps, DefaultProps> {
|
|
|
59
59
|
protected _onAttach(): void;
|
|
60
60
|
protected _onDetach(): void;
|
|
61
61
|
protected _onUpdate({ id, source }: Partial<MMapFeatureProps>): void;
|
|
62
|
+
protected _getDefaultProps(): DefaultProps;
|
|
62
63
|
private __onDragStart;
|
|
63
64
|
private __onDragMove;
|
|
64
65
|
private __onDragEnd;
|
|
@@ -4,6 +4,8 @@ import type { GenericGeometry, LngLat } from "../../common/types";
|
|
|
4
4
|
* But you can check it by `instance of` in MMapListener handlers
|
|
5
5
|
*/
|
|
6
6
|
declare class MMapHotspot {
|
|
7
|
+
private static _uid;
|
|
8
|
+
readonly id: string;
|
|
7
9
|
readonly geometry?: GenericGeometry<LngLat>;
|
|
8
10
|
readonly properties: Record<string, unknown>;
|
|
9
11
|
constructor(geometry: GenericGeometry<LngLat> | undefined, properties: Record<string, unknown>);
|
|
@@ -35,6 +35,7 @@ declare class MMapLayer extends MMapEntity<MMapLayerProps, DefaultProps> {
|
|
|
35
35
|
static defaultProps: Readonly<{
|
|
36
36
|
zIndex: 1500;
|
|
37
37
|
}>;
|
|
38
|
+
protected _getDefaultProps(props: MMapLayerProps): DefaultProps;
|
|
38
39
|
protected _onAttach(): void;
|
|
39
40
|
protected _onDetach(): void;
|
|
40
41
|
protected _onUpdate(): void;
|
|
@@ -145,15 +145,6 @@ declare class MMapMarker extends MMapGroupEntity<MMapMarkerProps, DefaultProps>
|
|
|
145
145
|
readonly element: HTMLElement;
|
|
146
146
|
private _destroyDomCtx?;
|
|
147
147
|
constructor(props: MMapMarkerProps, element?: HTMLElement);
|
|
148
|
-
protected _getDefaultProps(): Readonly<{
|
|
149
|
-
draggable: false;
|
|
150
|
-
mapFollowsOnDrag: false;
|
|
151
|
-
blockEvents: false;
|
|
152
|
-
blockBehaviors: false;
|
|
153
|
-
hideOutsideViewport: false;
|
|
154
|
-
zIndex: 0;
|
|
155
|
-
source: "mappable-default-feature";
|
|
156
|
-
}>;
|
|
157
148
|
private __feature;
|
|
158
149
|
get properties(): Record<string, unknown> | undefined;
|
|
159
150
|
get coordinates(): LngLat;
|
package/package.json
CHANGED
|
@@ -25,7 +25,7 @@ type DefaultProps = typeof defaultProps;
|
|
|
25
25
|
* map.addChild(controls);
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
|
-
declare class MMapZoomControl extends mappable.MMapComplexEntity<MMapZoomControlProps> {
|
|
28
|
+
declare class MMapZoomControl extends mappable.MMapComplexEntity<MMapZoomControlProps, DefaultProps> {
|
|
29
29
|
static [mappable.optionsKeyVuefy]: CustomVuefyOptions<MMapZoomControl>;
|
|
30
30
|
static defaultProps: Readonly<{
|
|
31
31
|
duration: 200;
|