@mappedin/mappedin-js 5.34.3 → 5.36.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.
@@ -1044,7 +1044,7 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedi
1044
1044
  map: MappedinMap | null;
1045
1045
  bearing: any;
1046
1046
  nearestNode: any;
1047
- forceBlueDot: boolean;
1047
+ hasEverReceivedFloorLevel: boolean;
1048
1048
  };
1049
1049
  export interface IBlueDotCore extends IPubSub {
1050
1050
  positionUpdater: IPositionUpdater | null;
@@ -1060,6 +1060,8 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.BlueDot/Mappedi
1060
1060
  Whether blue dot should be allowed with missing floor level information.
1061
1061
  */
1062
1062
  forceBlueDot: boolean;
1063
+ /** Whether we have received floorLevel data and are on a floorLevel supported device */
1064
+ hasEverReceivedFloorLevel: boolean;
1063
1065
  /**
1064
1066
  The state machine for the current state of the blue dot.
1065
1067
  */
@@ -4169,21 +4171,64 @@ declare module '@mappedin/mappedin-js/renderer/private/controllers/WatermarkCont
4169
4171
  import { Sprite } from 'three';
4170
4172
  type TPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'top' | 'bottom' | 'left' | 'right';
4171
4173
  export type TShowWatermarkOptions = {
4172
- padding?: number;
4173
- position?: TPosition;
4174
- iconOnly?: boolean;
4175
- scale?: number;
4176
- onClick?: () => void;
4174
+ /**
4175
+ * Padding in pixels. Can be a number or an object with top, right, bottom, and left properties.
4176
+ * @default 16
4177
+ * @example
4178
+ * ```ts
4179
+ * // Watermark with 20 pixels of padding on all sides
4180
+ * __showWatermark({
4181
+ * padding: 20,
4182
+ * });
4183
+ * ```
4184
+ * @example
4185
+ * ```ts
4186
+ * // Watermark with unique top, right, bottom, left padding
4187
+ * __showWatermark({
4188
+ * padding: {
4189
+ * top: 10,
4190
+ * right: 20,
4191
+ * bottom: 30,
4192
+ * left: 40,
4193
+ * },
4194
+ * });
4195
+ * ```
4196
+ */
4197
+ padding?: number | {
4198
+ top?: number;
4199
+ right?: number;
4200
+ bottom?: number;
4201
+ left?: number;
4202
+ };
4203
+ /**
4204
+ * Position of the watermark on the screen.
4205
+ * @default 'bottom-left'
4206
+ */
4207
+ position?: TPosition;
4208
+ /**
4209
+ * Show only the Mappedin icon without text.
4210
+ * @default false
4211
+ */
4212
+ iconOnly?: boolean;
4213
+ /**
4214
+ * Scale of the watermark between 0.5 and 1.5.
4215
+ * @default 1
4216
+ */
4217
+ scale?: number;
4218
+ /**
4219
+ * Callback when the watermark is clicked.
4220
+ */
4221
+ onClick?: () => void;
4177
4222
  };
4178
4223
  class WatermarkController {
4179
- #private;
4180
- static ENABLED: boolean;
4181
- static OPTIONS: Required<TShowWatermarkOptions>;
4182
- object?: Sprite;
4183
- constructor(core: ICore);
4184
- show: () => void;
4185
- hide: () => void;
4186
- resize: () => void;
4224
+ #private;
4225
+ static ENABLED: boolean;
4226
+ static OPTIONS: Required<TShowWatermarkOptions>;
4227
+ object?: Sprite;
4228
+ constructor(core: ICore);
4229
+ show: () => void;
4230
+ hide: () => void;
4231
+ resize: () => void;
4187
4232
  }
4188
4233
  export default WatermarkController;
4189
4234
  }
@@ -6205,13 +6250,49 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.FloatingLabel'
6205
6250
  inactive?: string;
6206
6251
  };
6207
6252
  /**
6208
- * Size of bounding box of SVG icon
6253
+ * Size of bounding box of the icon
6254
+ * @default 10
6209
6255
  */
6210
6256
  iconSize?: number;
6211
6257
  /**
6212
- * SVG of icon to place inside Floating Label
6258
+ * Icon to be placed inside the Floating Label marker. Supports SVG or a URL to png or jpeg.
6259
+ * @example
6260
+ * ```ts
6261
+ * // SVG
6262
+ * mapView.FloatingLabels.add(polygon, "Label", {
6263
+ * appearance: {
6264
+ * marker: {
6265
+ * icon: `<svg>...</svg>`,
6266
+ * },
6267
+ * },
6268
+ * });
6269
+ * ```
6270
+ *
6271
+ * @example
6272
+ * ```ts
6273
+ * // Image URL
6274
+ * mapView.FloatingLabels.add(polygon, "Label", {
6275
+ * appearance: {
6276
+ * marker: {
6277
+ * icon: 'https://example.com/icon.png',
6278
+ * },
6279
+ * },
6280
+ * });
6281
+ * ```
6213
6282
  */
6214
6283
  icon?: string;
6284
+ /**
6285
+ * How the icon should fit inside the marker. By default, this is not set and the icon will be centered inside the marker.
6286
+ * - `fill` will stretch the icon to fill the marker.
6287
+ * - `cover` will maintain aspect ratio and fill the marker.
6288
+ * - `contain` will maintain aspect ratio and fit the icon inside the marker.
6289
+ */
6290
+ iconFit?: 'contain' | 'fill' | 'cover';
6291
+ /**
6292
+ * Padding around the icon, in pixels.
6293
+ * @default 4
6294
+ */
6295
+ iconPadding?: number;
6215
6296
  /**
6216
6297
  * Defines when the icon becomes visible relative to the current zoom level
6217
6298
  * anything below 0 will result in icons never showing up
@@ -6243,6 +6324,8 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.FloatingLabel'
6243
6324
  };
6244
6325
  iconSize?: number;
6245
6326
  icon?: string;
6327
+ iconFit?: 'fill' | 'cover' | 'contain';
6328
+ iconPadding: number;
6246
6329
  iconVisibilityThreshold?: number;
6247
6330
  };
6248
6331
  };
@@ -6309,6 +6392,12 @@ declare module '@mappedin/mappedin-js/renderer/internal/Mappedin.FloatingLabel'
6309
6392
  static imagePromiseCache: {
6310
6393
  [key in number]?: Promise<HTMLImageElement>;
6311
6394
  };
6395
+ static imageDimensionsCache: {
6396
+ [key in number]: {
6397
+ width: number;
6398
+ height: number;
6399
+ };
6400
+ };
6312
6401
  get pinCanvasSize(): number;
6313
6402
  draw(context: CanvasRenderingContext2D): void;
6314
6403
  }
@@ -6983,29 +7072,33 @@ declare module '@mappedin/mappedin-js/renderer/internal/json-scene-loader' {
6983
7072
  import { MappedinMap, MappedinPolygon } from '@mappedin/mappedin-js/renderer/internal';
6984
7073
  import { MAP_RENDER_MODE } from '@mappedin/mappedin-js/renderer/MapView.enums';
6985
7074
  class JSONSceneLoader {
6986
- defaultExtrudeSettings: {
6987
- amount: number;
6988
- bevelEnabled: boolean;
6989
- };
6990
- materials: {};
6991
- scale: number;
6992
- assetManager: DefaultAssetManager;
6993
- setAssetManager<T extends DefaultAssetManager>(am: T): void;
6994
- overlayHeight: number;
6995
- /**
6996
- Takes in either an object containing polygons and generates a 3D scene based
6997
- on it, or a string URL to fetch those polygons from.
6998
- **/
6999
- load(polygons: string | MappedinPolygon[], mapClass: MappedinMap, mapLoadingStrategy?: MAP_RENDER_MODE): Promise<{
7000
- container: Group<import("three").Object3DEventMap>;
7001
- elements: (Element | null)[];
7002
- visibleLayers: Set<unknown>;
7003
- }>;
7004
- _build(polygons: MappedinPolygon[], mapClass: MappedinMap, mapLoadingStrategy?: MAP_RENDER_MODE): Promise<{
7005
- container: Group<import("three").Object3DEventMap>;
7006
- elements: (Element | null)[];
7007
- visibleLayers: Set<unknown>;
7008
- }>;
7075
+ defaultExtrudeSettings: {
7076
+ amount: number;
7077
+ bevelEnabled: boolean;
7078
+ };
7079
+ materials: {};
7080
+ scale: number;
7081
+ assetManager: DefaultAssetManager;
7082
+ setAssetManager<T extends DefaultAssetManager>(am: T): void;
7083
+ overlayHeight: number;
7084
+ /**
7085
+ Takes in either an object containing polygons and generates a 3D scene based
7086
+ on it, or a string URL to fetch those polygons from.
7087
+ **/
7088
+ load(polygons: string | MappedinPolygon[], mapClass: MappedinMap, mapLoadingStrategy?: MAP_RENDER_MODE, allLayersVisible?: boolean): Promise<{
7089
+ container: Group<import("three").Object3DEventMap>;
7090
+ elements: (Element | null)[];
7091
+ visibleLayers: Set<unknown>;
7092
+ }>;
7093
+ _build(polygons: MappedinPolygon[], mapClass: MappedinMap, mapLoadingStrategy?: MAP_RENDER_MODE,
7094
+ /**
7095
+ * If true, sets all layers to be visible. If false, uses the layer visibility from the mapClass.
7096
+ */
7097
+ allLayersVisible?: boolean): Promise<{
7098
+ container: Group<import("three").Object3DEventMap>;
7099
+ elements: (Element | null)[];
7100
+ visibleLayers: Set<unknown>;
7101
+ }>;
7009
7102
  }
7010
7103
  const _default: JSONSceneLoader;
7011
7104
  export default _default;