@mappedin/mappedin-js 6.0.1-alpha.19 → 6.0.1-alpha.20

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.
@@ -963,21 +963,64 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/private/controlle
963
963
  import { Sprite } from 'three';
964
964
  type TPosition = 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center' | 'top' | 'bottom' | 'left' | 'right';
965
965
  export type TShowWatermarkOptions = {
966
- padding?: number;
967
- position?: TPosition;
968
- iconOnly?: boolean;
969
- scale?: number;
970
- onClick?: () => void;
966
+ /**
967
+ * Padding in pixels. Can be a number or an object with top, right, bottom, and left properties.
968
+ * @default 16
969
+ * @example
970
+ * ```ts
971
+ * // Watermark with 20 pixels of padding on all sides
972
+ * __showWatermark({
973
+ * padding: 20,
974
+ * });
975
+ * ```
976
+ * @example
977
+ * ```ts
978
+ * // Watermark with unique top, right, bottom, left padding
979
+ * __showWatermark({
980
+ * padding: {
981
+ * top: 10,
982
+ * right: 20,
983
+ * bottom: 30,
984
+ * left: 40,
985
+ * },
986
+ * });
987
+ * ```
988
+ */
989
+ padding?: number | {
990
+ top?: number;
991
+ right?: number;
992
+ bottom?: number;
993
+ left?: number;
994
+ };
995
+ /**
996
+ * Position of the watermark on the screen.
997
+ * @default 'bottom-left'
998
+ */
999
+ position?: TPosition;
1000
+ /**
1001
+ * Show only the Mappedin icon without text.
1002
+ * @default false
1003
+ */
1004
+ iconOnly?: boolean;
1005
+ /**
1006
+ * Scale of the watermark between 0.5 and 1.5.
1007
+ * @default 1
1008
+ */
1009
+ scale?: number;
1010
+ /**
1011
+ * Callback when the watermark is clicked.
1012
+ */
1013
+ onClick?: () => void;
971
1014
  };
972
1015
  class WatermarkController {
973
- #private;
974
- static ENABLED: boolean;
975
- static OPTIONS: Required<TShowWatermarkOptions>;
976
- object?: Sprite;
977
- constructor(core: ICore);
978
- show: () => void;
979
- hide: () => void;
980
- resize: () => void;
1016
+ #private;
1017
+ static ENABLED: boolean;
1018
+ static OPTIONS: Required<TShowWatermarkOptions>;
1019
+ object?: Sprite;
1020
+ constructor(core: ICore);
1021
+ show: () => void;
1022
+ hide: () => void;
1023
+ resize: () => void;
981
1024
  }
982
1025
  export default WatermarkController;
983
1026
  }
@@ -1679,20 +1722,47 @@ declare module '@mappedin/mappedin-js/maker/src/map-view-interface' {
1679
1722
  inactive?: string;
1680
1723
  };
1681
1724
  /**
1682
- * Size of bounding box of SVG icon in pixels
1725
+ * Size of bounding box of the icon in pixels
1726
+ * @default 10
1683
1727
  */
1684
1728
  iconSize?: number;
1685
1729
  /**
1686
- * SVG of icon to place inside a label
1730
+ * Icon to be placed inside label. Supports SVG or a URL to png or jpeg.
1687
1731
  *
1688
1732
  * @example
1689
- * <svg height="16" viewBox="0 0 36 36" width="16">
1690
- * <g fill="white">
1691
- * ${icon}
1692
- * </g>
1693
- * </svg>
1733
+ * ```ts
1734
+ * // SVG
1735
+ * mapView.Labels.add(space, space.name, {
1736
+ * appearance: {
1737
+ * icon: `<svg>...</svg>`
1738
+ * },
1739
+ * });
1740
+ * ```
1741
+ *
1742
+ * @example
1743
+ * ```ts
1744
+ * // Image URL
1745
+ * mapView.Labels.add(space, space.name, {
1746
+ * appearance: {
1747
+ * icon: 'https://example.com/icon.png',
1748
+ * },
1749
+ * });
1750
+ * ```
1694
1751
  */
1695
1752
  icon?: string;
1753
+ /**
1754
+ * How the icon should fit inside the marker.
1755
+ * - `fill` will stretch the icon to fill the marker.
1756
+ * - `cover` will maintain aspect ratio and fill the marker.
1757
+ * - `contain` will maintain aspect ratio and fit the icon inside the marker.
1758
+ * @default 'fill'
1759
+ */
1760
+ iconFit?: 'contain' | 'fill' | 'cover';
1761
+ /**
1762
+ * Padding around the icon, in pixels.
1763
+ * @default 4
1764
+ */
1765
+ iconPadding?: number;
1696
1766
  /**
1697
1767
  * Defines when the icon becomes visible relative to the current zoom level
1698
1768
  * anything below 0 will result in icons never showing up
@@ -8080,13 +8150,49 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
8080
8150
  inactive?: string;
8081
8151
  };
8082
8152
  /**
8083
- * Size of bounding box of SVG icon
8153
+ * Size of bounding box of the icon
8154
+ * @default 10
8084
8155
  */
8085
8156
  iconSize?: number;
8086
8157
  /**
8087
- * SVG of icon to place inside Floating Label
8158
+ * Icon to be placed inside the Floating Label marker. Supports SVG or a URL to png or jpeg.
8159
+ * @example
8160
+ * ```ts
8161
+ * // SVG
8162
+ * mapView.FloatingLabels.add(polygon, "Label", {
8163
+ * appearance: {
8164
+ * marker: {
8165
+ * icon: `<svg>...</svg>`,
8166
+ * },
8167
+ * },
8168
+ * });
8169
+ * ```
8170
+ *
8171
+ * @example
8172
+ * ```ts
8173
+ * // Image URL
8174
+ * mapView.FloatingLabels.add(polygon, "Label", {
8175
+ * appearance: {
8176
+ * marker: {
8177
+ * icon: 'https://example.com/icon.png',
8178
+ * },
8179
+ * },
8180
+ * });
8181
+ * ```
8088
8182
  */
8089
8183
  icon?: string;
8184
+ /**
8185
+ * How the icon should fit inside the marker. By default, this is not set and the icon will be centered inside the marker.
8186
+ * - `fill` will stretch the icon to fill the marker.
8187
+ * - `cover` will maintain aspect ratio and fill the marker.
8188
+ * - `contain` will maintain aspect ratio and fit the icon inside the marker.
8189
+ */
8190
+ iconFit?: 'contain' | 'fill' | 'cover';
8191
+ /**
8192
+ * Padding around the icon, in pixels.
8193
+ * @default 4
8194
+ */
8195
+ iconPadding?: number;
8090
8196
  /**
8091
8197
  * Defines when the icon becomes visible relative to the current zoom level
8092
8198
  * anything below 0 will result in icons never showing up
@@ -8118,6 +8224,8 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
8118
8224
  };
8119
8225
  iconSize?: number;
8120
8226
  icon?: string;
8227
+ iconFit?: 'fill' | 'cover' | 'contain';
8228
+ iconPadding: number;
8121
8229
  iconVisibilityThreshold?: number;
8122
8230
  };
8123
8231
  };
@@ -8184,6 +8292,12 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
8184
8292
  static imagePromiseCache: {
8185
8293
  [key in number]?: Promise<HTMLImageElement>;
8186
8294
  };
8295
+ static imageDimensionsCache: {
8296
+ [key in number]: {
8297
+ width: number;
8298
+ height: number;
8299
+ };
8300
+ };
8187
8301
  get pinCanvasSize(): number;
8188
8302
  draw(context: CanvasRenderingContext2D): void;
8189
8303
  }
@@ -10286,7 +10400,7 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
10286
10400
  map: MappedinMap | null;
10287
10401
  bearing: any;
10288
10402
  nearestNode: any;
10289
- forceBlueDot: boolean;
10403
+ hasEverReceivedFloorLevel: boolean;
10290
10404
  };
10291
10405
  export interface IBlueDotCore extends IPubSub {
10292
10406
  positionUpdater: IPositionUpdater | null;
@@ -10302,6 +10416,8 @@ declare module '@mappedin/mappedin-js/packages/legacy-renderer/internal/Mappedin
10302
10416
  Whether blue dot should be allowed with missing floor level information.
10303
10417
  */
10304
10418
  forceBlueDot: boolean;
10419
+ /** Whether we have received floorLevel data and are on a floorLevel supported device */
10420
+ hasEverReceivedFloorLevel: boolean;
10305
10421
  /**
10306
10422
  The state machine for the current state of the blue dot.
10307
10423
  */