@mappable-world/mappable-types 0.0.14 → 0.0.15

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.
@@ -130,6 +130,7 @@ interface VectorTileDataSourceDescription {
130
130
  allObjectsInteractive?: boolean;
131
131
  /** Forces tiles to wait for the icons, disables hiding icons by zoom diff */
132
132
  iconsOnlyTiles?: boolean;
133
+ richModelDecoderWorkerUrl?: string;
133
134
  customization?: VectorCustomization;
134
135
  theme?: MapTheme;
135
136
  /** Defines how hotspots of type should be treated: enabled/disabled or use custom hotspots instead. */
@@ -35,9 +35,9 @@ export type MMapLocation = MMapCenterZoomLocation & Partial<MMapBoundsLocation>;
35
35
  * Observer camera position
36
36
  */
37
37
  export type MMapCamera = {
38
- /** Map tilt in radians. Can take values from 0 to 45 degrees (degrees * (Math.PI / 180)) */
38
+ /** Map tilt in radians. Can take values from 0 to 50 degrees (degrees * (Math.PI / 180)) */
39
39
  tilt?: number;
40
- /** Map rotation in degrees. Can take values from -180 to 180 degrees */
40
+ /** Map rotation in radians. Can take values from -Math.PI to Math.PI */
41
41
  azimuth?: number;
42
42
  };
43
43
  /**
@@ -85,6 +85,8 @@ export type MMapProps = {
85
85
  hotspotsStrategy?: "forViewport" | "forPointerPosition";
86
86
  /** Position of copyright on the page. Default is 'bottom right' */
87
87
  copyrightsPosition?: MMapCopyrightsPosition;
88
+ /** Show the map scale next to copyright */
89
+ showScaleInCopyrights?: boolean;
88
90
  /**
89
91
  * Projection used in map
90
92
  */
@@ -111,6 +113,7 @@ declare const defaultProps: Readonly<{
111
113
  margin: Margin | undefined;
112
114
  copyrights: true;
113
115
  copyrightsPosition: "bottom right";
116
+ showScaleInCopyrights: false;
114
117
  worldOptions: {
115
118
  cycledX: boolean;
116
119
  cycledY: boolean;
@@ -157,6 +160,7 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
157
160
  margin: Margin | undefined;
158
161
  copyrights: true;
159
162
  copyrightsPosition: "bottom right";
163
+ showScaleInCopyrights: false;
160
164
  worldOptions: {
161
165
  cycledX: boolean;
162
166
  cycledY: boolean;
@@ -181,6 +185,7 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
181
185
  hotspotsStrategy?: "forViewport" | "forPointerPosition" | undefined;
182
186
  copyrights?: boolean | undefined;
183
187
  copyrightsPosition?: MMapCopyrightsPosition | undefined;
188
+ showScaleInCopyrights?: boolean | undefined;
184
189
  projection?: Projection | undefined;
185
190
  worldOptions?: WorldOptions | undefined;
186
191
  theme?: MMapTheme | undefined;
@@ -257,6 +262,11 @@ declare class MMap extends GenericRootEntity<MMapProps, DefaultProps> {
257
262
  * @param location
258
263
  */
259
264
  setLocation(location: MMapLocationRequest): void;
265
+ /**
266
+ * setter for {@link MMapProps}.camera prop
267
+ * @param camera
268
+ */
269
+ setCamera(camera: MMapCameraRequest): void;
260
270
  private __setLocation;
261
271
  /**
262
272
  * setter for {@link MMapProps}.mode prop
@@ -3,7 +3,14 @@ import { MMapGroupEntity } from "../MMapEnities";
3
3
  /**
4
4
  * MMapControl props
5
5
  */
6
- export type MMapControlProps = {};
6
+ export type MMapControlProps = {
7
+ /** Makes the control transparent by removing background color and shadows */
8
+ transparent?: boolean;
9
+ };
10
+ declare const defaultProps: Readonly<{
11
+ transparent: false;
12
+ }>;
13
+ type DefaultProps = typeof defaultProps;
7
14
  /**
8
15
  * DOM wrapper for creating custom controls. Connects the styles required by the control.
9
16
  *
@@ -30,20 +37,27 @@ export type MMapControlProps = {};
30
37
  *
31
38
  * @module MMapControl
32
39
  */
33
- export declare class MMapControl<T extends MMapControlProps = MMapControlProps> extends MMapGroupEntity<T> {
34
- static [overrideKeyReactify]: import("../../reactify/reactify").CustomReactify<MMapControl<MMapControlProps>, import("react").ForwardRefExoticComponent<{
40
+ export declare class MMapControl extends MMapGroupEntity<MMapControlProps, DefaultProps> {
41
+ static defaultProps: Readonly<{
42
+ transparent: false;
43
+ }>;
44
+ static [overrideKeyReactify]: import("../../reactify/reactify").CustomReactify<MMapControl, import("react").ForwardRefExoticComponent<{
45
+ transparent?: boolean | undefined;
35
46
  children?: import("react").ReactNode;
36
- ref?: import("react").Ref<import("../Entities").GenericEntity<{
47
+ ref?: import("react").Ref<import("../Entities").GenericEntity<MMapControlProps & {
37
48
  controlElement: HTMLElement;
38
49
  }, {}, import("../Entities").GenericRootEntity<unknown, {}>>> | undefined;
39
50
  key?: import("react").Key | null | undefined;
40
51
  }>>;
41
- private _detachDom?;
42
52
  private _element?;
53
+ private _detachDom?;
43
54
  private _unwatchThemeContext?;
44
- constructor();
55
+ constructor(props?: MMapControlProps);
45
56
  protected _createDom(): HTMLElement;
46
57
  protected _onAttach(): void;
58
+ protected _onUpdate(props: Partial<MMapControlProps>): void;
59
+ private __watchThemeContext;
47
60
  protected _onDetach(): void;
48
61
  private _updateTheme;
49
62
  }
63
+ export {};
@@ -3,9 +3,12 @@ type MMapCopyrightsPosition = "top left" | "top right" | "bottom left" | "bottom
3
3
  type MMapCopyrightsProps = {
4
4
  /** Position of copyright on the map */
5
5
  position?: MMapCopyrightsPosition;
6
+ /** Show the map scale next to the map */
7
+ showScale?: boolean;
6
8
  };
7
9
  declare const defaultProps: Readonly<{
8
10
  position: MMapCopyrightsPosition;
11
+ showScale: false;
9
12
  }>;
10
13
  type DefaultProps = typeof defaultProps;
11
14
  /**
@@ -15,12 +18,15 @@ type DefaultProps = typeof defaultProps;
15
18
  declare class MMapCopyrights extends MMapGroupEntity<MMapCopyrightsProps, DefaultProps> {
16
19
  static defaultProps: Readonly<{
17
20
  position: MMapCopyrightsPosition;
21
+ showScale: false;
18
22
  }>;
19
23
  private _boxElement;
20
24
  private _copyrightsTextElement;
21
25
  private _linkElement;
22
26
  private _logoElement;
23
27
  private _copyrightsContainer;
28
+ private _scaleElement;
29
+ private _scaleControl;
24
30
  private _mapWidth;
25
31
  private _copyrights;
26
32
  private _fixedCopyrights;
@@ -30,8 +36,8 @@ declare class MMapCopyrights extends MMapGroupEntity<MMapCopyrightsProps, Defaul
30
36
  private _unwatchThemeContext?;
31
37
  private _detachDom?;
32
38
  constructor(props?: MMapCopyrightsProps);
33
- protected _updateDom(): void;
34
39
  protected _onAttach(): void;
40
+ protected _onUpdate(props: Partial<MMapCopyrightsProps>): void;
35
41
  protected _onDetach(): void;
36
42
  private _createDom;
37
43
  private _syncDom;
@@ -43,5 +49,6 @@ declare class MMapCopyrights extends MMapGroupEntity<MMapCopyrightsProps, Defaul
43
49
  private _setFixedCopyrights;
44
50
  private _copyrightsChangeHandler;
45
51
  private _adjustText;
52
+ private _toggleScaleControl;
46
53
  }
47
54
  export { MMapCopyrights, MMapCopyrightsPosition, MMapCopyrightsProps };
@@ -2,7 +2,7 @@ import { MMapComplexEntity } from "../MMapEnities";
2
2
  interface MMapCoverageProps {
3
3
  onError?: (e: Error) => void;
4
4
  }
5
- export declare const COVERAGE_LAYERS_TO_SOURCES: Record<string, string>;
5
+ export declare const COVERAGE_LAYERS_TO_SOURCES: Map<string, string>;
6
6
  /**
7
7
  * The component of loading data on copyrights on the map and the zoom range for
8
8
  * the area where the center of the map is located
@@ -7,6 +7,8 @@ type MMapDefaultFeaturesLayerProps = {
7
7
  visible?: boolean;
8
8
  /** Layer z-index */
9
9
  zIndex?: number;
10
+ /** Name for source */
11
+ source?: string;
10
12
  };
11
13
  declare const defaultProps: Readonly<{
12
14
  visible: true;
@@ -1,10 +1,15 @@
1
1
  import type { VectorCustomization } from "../../common/types";
2
+ import { MMapLayerProps } from "../MMapLayer";
2
3
  import { MMapComplexEntity } from "../MMapEnities";
4
+ type MMapDefaultSchemeLayerType = "ground" | "buildings" | "icons" | "labels";
3
5
  /**
4
6
  * MMapDefaultSchemeLayer props
5
7
  */
6
8
  type MMapDefaultSchemeLayerProps = {
7
- /** Should show layer */
9
+ /**
10
+ * Should show layers
11
+ * @deprecated use {@link MMapDefaultSchemeLayerProps}.layers instead
12
+ */
8
13
  visible?: boolean;
9
14
  /** Vector tiles customization. */
10
15
  customization?: VectorCustomization;
@@ -13,28 +18,33 @@ type MMapDefaultSchemeLayerProps = {
13
18
  * @deprecated use {@link MMapProps}.theme prop in {@link MMap} instead
14
19
  * */
15
20
  theme?: "dark" | "light";
21
+ /** Name for source */
22
+ source?: string;
23
+ /** Layers parameters */
24
+ layers?: Partial<Record<MMapDefaultSchemeLayerType, Partial<MMapLayerProps>>>;
16
25
  };
17
26
  declare const defaultProps: {
18
27
  visible: boolean;
19
28
  source: string;
20
- layersInfo: {
29
+ layers: {
21
30
  ground: {
22
- type: string;
23
31
  zIndex: number;
24
32
  };
25
33
  buildings: {
26
- type: string;
27
34
  zIndex: number;
28
35
  };
29
36
  icons: {
30
- type: string;
31
37
  zIndex: number;
32
38
  };
33
39
  labels: {
34
- type: string;
35
40
  zIndex: number;
36
41
  };
37
42
  };
43
+ /** @deprecated use {@link DefaultProps}.layers instead */
44
+ readonly layersInfo: Record<MMapDefaultSchemeLayerType, {
45
+ type: string;
46
+ zIndex: number;
47
+ }>;
38
48
  };
39
49
  type DefaultProps = typeof defaultProps;
40
50
  /**
@@ -53,24 +63,25 @@ declare class MMapDefaultSchemeLayer extends MMapComplexEntity<MMapDefaultScheme
53
63
  static defaultProps: {
54
64
  visible: boolean;
55
65
  source: string;
56
- layersInfo: {
66
+ layers: {
57
67
  ground: {
58
- type: string;
59
68
  zIndex: number;
60
69
  };
61
70
  buildings: {
62
- type: string;
63
71
  zIndex: number;
64
72
  };
65
73
  icons: {
66
- type: string;
67
74
  zIndex: number;
68
75
  };
69
76
  labels: {
70
- type: string;
71
77
  zIndex: number;
72
78
  };
73
79
  };
80
+ /** @deprecated use {@link DefaultProps}.layers instead */
81
+ readonly layersInfo: Record<MMapDefaultSchemeLayerType, {
82
+ type: string;
83
+ zIndex: number;
84
+ }>;
74
85
  };
75
86
  private _dataSource?;
76
87
  private _layers;
@@ -64,6 +64,7 @@ declare class MMapFeature extends MMapEntity<MMapFeatureProps, DefaultProps> {
64
64
  private __onClick;
65
65
  private __onDoubleClick;
66
66
  private __onFastClick;
67
- private __isMy;
67
+ private __isMySomeObject;
68
+ private __isMyDraggableObject;
68
69
  }
69
70
  export { MMapFeature, MMapFeatureProps };
@@ -1,5 +1,5 @@
1
- import { MMapComplexEntity } from "../../../imperative";
2
- export type UnitType = 'imperial' | 'metric' | 'nautical';
1
+ import { MMapComplexEntity } from "../MMapEnities";
2
+ export type UnitType = "imperial" | "metric" | "nautical";
3
3
  type MMapScaleControlProps = {
4
4
  /** Maximum width of scale line in pixels */
5
5
  maxWidth?: number;
@@ -7,13 +7,13 @@ type MMapScaleControlProps = {
7
7
  unit?: UnitType;
8
8
  };
9
9
  declare const defaultProps: Readonly<{
10
- maxWidth: 85;
10
+ maxWidth: 74;
11
11
  unit: "metric";
12
12
  }>;
13
13
  type DefaultProps = typeof defaultProps;
14
14
  declare class MMapScaleControl extends MMapComplexEntity<MMapScaleControlProps, DefaultProps> {
15
15
  static defaultProps: Readonly<{
16
- maxWidth: 85;
16
+ maxWidth: 74;
17
17
  unit: "metric";
18
18
  }>;
19
19
  private _unwatchThemeContext?;
@@ -50,9 +50,12 @@ type MMapTileDataSourceProps = {
50
50
  */
51
51
  declare class MMapTileDataSource extends MMapEntity<MMapTileDataSourceProps> {
52
52
  private _id;
53
+ private _unwatchVectorContext?;
53
54
  protected _onAttach(): void;
54
55
  protected _onDetach(): void;
55
56
  protected _onUpdate(props: Partial<MMapTileDataSourceProps>): void;
56
- private _validateVectorSource;
57
+ private _getDataSourceDescription;
58
+ private _onVectorContextUpdate;
59
+ private _prepareVectorSource;
57
60
  }
58
61
  export { MMapTileDataSource, MMapTileDataSourceProps };
@@ -17,6 +17,7 @@ export { MMapControls, MMapControlsProps } from "./MMapControls";
17
17
  export { MMapControl, MMapControlProps, MMapControlButton, MMapControlButtonProps, MMapControlCommonButton } from "./MMapControl";
18
18
  export { MMapCollection } from "./MMapCollection";
19
19
  export { MMapContainer, MMapContainerProps, MMapContainerPropsImpl, ComputedMMapContainerProps } from "./MMapContainer";
20
+ export { MMapScaleControl, MMapScaleControlProps } from "./MMapScaleControl";
20
21
  export * from "./mappable-worldMaps";
21
22
  export * from "./search";
22
23
  export * from "./suggest";
@@ -1,4 +1,4 @@
1
1
  import { Config } from "../config";
2
- import type { BaseRouteResponse, RouteOptions } from "./interface";
2
+ import type { BaseRouteResponse, RouteOptions, RouteFeature } from "./interface";
3
3
  export declare function route(options: RouteOptions, config?: Config | undefined): Promise<BaseRouteResponse[]>;
4
- export { RouteOptions, BaseRouteResponse };
4
+ export { RouteOptions, BaseRouteResponse, RouteFeature };
package/import.d.ts CHANGED
@@ -4,9 +4,16 @@ export type Module = Function | null | {
4
4
  [key: string]: Function | object;
5
5
  };
6
6
  export type Loader = (pkg: string) => Promise<Module> | Module;
7
+ type Packages = Record<string, {
8
+ version: string;
9
+ path?: string;
10
+ export?: string;
11
+ }>;
7
12
  export interface Import {
8
13
  loaders: Loader[];
9
14
  default: Loader;
15
+ cdn: (templatePath: string, packages: Packages | string[] | string) => Loader;
16
+ registerCdn: (templatePath: string, packages: Packages | string[] | string) => void;
10
17
  script: (url: string) => Promise<unknown>;
11
18
  cssText: (cssText: string, name: string) => Promise<unknown>;
12
19
  style: (url: string) => Promise<unknown>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mappable-world/mappable-types",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Types for mappable maps library",
5
5
  "main": "",
6
6
  "types": "index.d.ts",