azure-maps-control 2.1.10 → 2.1.11

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "azure-maps-control",
3
3
  "author": "Microsoft Corporation",
4
- "version": "2.1.10",
4
+ "version": "2.1.11",
5
5
  "description": "Map SDK for Azure Maps",
6
6
  "keywords": [
7
7
  "azure",
@@ -629,9 +629,9 @@ declare namespace atlas {
629
629
  */
630
630
  onRemove(): void;
631
631
  /**
632
- * Set the style that need to be displayed as currently selected.
632
+ * Set the style that need to be displayed as currently selected.
633
633
  * Style will automatically get selected if `StyleControlOptions.autoSelectionMode` is `true`
634
- * @param styleName - Style name that need to be disabled as currently selected
634
+ * @param styleName - Style name that need to be disabled as currently selected
635
635
  */
636
636
  setSelectedStyle(styleName: string): void;
637
637
  /**
@@ -702,7 +702,7 @@ declare namespace atlas {
702
702
  * Sets the control state
703
703
  */
704
704
  set isActive(newValue: boolean);
705
-
705
+
706
706
  /**
707
707
  * Initialization method for the control which is called when added to the map.
708
708
  * @param map The map that the control will be added to.
@@ -1817,11 +1817,11 @@ declare namespace atlas {
1817
1817
  /**
1818
1818
  * Perform a Douglas-Peucker simplification on an array of positions or pixels.
1819
1819
  * @param points The position or pixel points to simplify.
1820
- * @param tolerance A tolerance to use in the simplification.
1821
- * @returns A new array of the simplified set of points.
1820
+ * @param tolerance A tolerance to use in the simplification.
1821
+ * @returns A new array of the simplified set of points.
1822
1822
  */
1823
1823
  export function simplify(points: (Position | Pixel)[], tolerance: number): (Position | Pixel)[];
1824
-
1824
+
1825
1825
  /**
1826
1826
  * Denormalizes path on antimeridian, this makes lines with coordinates on the opposite side of the antimeridian to always cross it. Note that the path crossing antimeridian will contain longitude outside of -180 to 180 range.
1827
1827
  * See getPathSplitByAntimeridian when this is not desired.
@@ -1844,7 +1844,6 @@ declare namespace atlas {
1844
1844
  */
1845
1845
  export class Map {
1846
1846
  private readonly styleLayerIds;
1847
- private readonly styleSourceIds;
1848
1847
  private readonly map;
1849
1848
  private localizedStringsPromise;
1850
1849
  private insights;
@@ -2613,7 +2612,7 @@ declare namespace atlas {
2613
2612
  */
2614
2613
  export function setLanguage(language: string): void;
2615
2614
  /**
2616
- * Sets Maximum number of images (raster tiles, sprites, icons) to load in parallel,
2615
+ * Sets Maximum number of images (raster tiles, sprites, icons) to load in parallel,
2617
2616
  * which affects performance in raster-heavy maps. 16 by default.
2618
2617
  * @param maxParallelImageRequests Maximum number of images to load in parallel.
2619
2618
  */
@@ -2821,6 +2820,12 @@ declare namespace atlas {
2821
2820
  * @default false
2822
2821
  */
2823
2822
  optional?: boolean;
2823
+ /**
2824
+ * Size of the additional area around the icon bounding box used for detecting symbol collisions.
2825
+ * Default `2`.
2826
+ * @default 2
2827
+ */
2828
+ padding?: number | Expression;
2824
2829
  /**
2825
2830
  * Specifies the orientation of the icon when the map is pitched.
2826
2831
  * <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
@@ -2911,15 +2916,15 @@ declare namespace atlas {
2911
2916
  sourceLayer?: string;
2912
2917
 
2913
2918
  /**
2914
- * Specifies the color gradient used to colorize the pixels in the heatmap.
2915
- * This is defined using an expression that uses `["heatmap-density"]` as input.
2919
+ * Specifies the color gradient used to colorize the pixels in the heatmap.
2920
+ * This is defined using an expression that uses `["heatmap-density"]` as input.
2916
2921
  * Default `["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"]`
2917
2922
  * @default `["interpolate",["linear"],["heatmap-density"],0,"rgba(0,0, 255,0)",0.1,"royalblue",0.3,"cyan",0.5,"lime",0.7,"yellow",1,"red"]`
2918
2923
  */
2919
2924
  color?: Expression;
2920
2925
 
2921
2926
  /**
2922
- * Similar to `heatmap-weight` but specifies the global heatmap intensity.
2927
+ * Similar to `heatmap-weight` but specifies the global heatmap intensity.
2923
2928
  * The higher this value is, the more ‘weight’ each point will contribute to the appearance.
2924
2929
  * Default `1`
2925
2930
  * @default 1
@@ -2934,7 +2939,7 @@ declare namespace atlas {
2934
2939
  opacity?: number | Expression;
2935
2940
 
2936
2941
  /**
2937
- * The radius in pixels used to render a data point on the heatmap.
2942
+ * The radius in pixels used to render a data point on the heatmap.
2938
2943
  * The radius must be a number greater or equal to 1.
2939
2944
  * Default `30`.
2940
2945
  * @default 30
@@ -2942,9 +2947,9 @@ declare namespace atlas {
2942
2947
  radius?: number | Expression;
2943
2948
 
2944
2949
  /**
2945
- * Specifies how much an individual data point contributes to the heatmap.
2946
- * Must be a number greater than 0. A value of 5 would be equivalent to having 5 points of weight 1 in the same spot.
2947
- * This is useful when clustering points to allow heatmap rendering or large datasets.
2950
+ * Specifies how much an individual data point contributes to the heatmap.
2951
+ * Must be a number greater than 0. A value of 5 would be equivalent to having 5 points of weight 1 in the same spot.
2952
+ * This is useful when clustering points to allow heatmap rendering or large datasets.
2948
2953
  * Default `1`
2949
2954
  * @default 1
2950
2955
  */
@@ -3254,6 +3259,26 @@ declare namespace atlas {
3254
3259
  * @default "point"
3255
3260
  */
3256
3261
  placement?: "point" | "line" | "line-center";
3262
+ /**
3263
+ * Sorts features in ascending order based on this value. Features with
3264
+ * lower sort keys are drawn and placed first.
3265
+ * Default `undefined`.
3266
+ * @default undefined
3267
+ */
3268
+ sortKey?: number | Expression;
3269
+ /**
3270
+ * Determines whether overlapping symbols in the same layer are rendered in the order
3271
+ * that they appear in the data source, or by their y position relative to the viewport.
3272
+ * To control the order and prioritization of symbols otherwise, use `sortKey`.
3273
+ * <p>`"auto"`: Sorts symbols by `sortKey` if set. Otherwise behaves like `"viewport-y"`.
3274
+ * <p>`"viewport-y"`: Sorts symbols by their y position if `allowOverlap` is `true` or
3275
+ * if `ignorePlacement` is `false`.
3276
+ * <p>`"source"`: Sorts symbols by `sortKey` if set. Otherwise, symbols are rendered in the
3277
+ * same order as the source data.
3278
+ * Default `"auto"`
3279
+ * @default "auto"
3280
+ */
3281
+ zOrder?: "auto" | "viewport-y" | "source";
3257
3282
  /**
3258
3283
  * Distance in pixels between two symbol anchors along a line. Must be greater or equal to 1.
3259
3284
  * Default `250`.
@@ -3312,6 +3337,16 @@ declare namespace atlas {
3312
3337
  * @default false
3313
3338
  */
3314
3339
  ignorePlacement?: boolean;
3340
+ /**
3341
+ * Text justification options.
3342
+ * <p>`"auto"`: The text is aligned towards the anchor position.
3343
+ * <p>`"left"`: The text is aligned to the left.
3344
+ * <p>`"center"`: The text is centered.
3345
+ * <p>`"right"`: The text is aligned to the right.
3346
+ * Default `"center"`.
3347
+ * @default "center"
3348
+ */
3349
+ justify?: "auto" | "left" | "center" | "right";
3315
3350
  /**
3316
3351
  * Specifies an offset distance of the icon from its anchor in ems.
3317
3352
  * Positive values indicate right and down, while negative values indicate left and up.
@@ -3327,6 +3362,13 @@ declare namespace atlas {
3327
3362
  * @default false
3328
3363
  */
3329
3364
  optional?: boolean;
3365
+ /**
3366
+ * Size of the additional area around the text bounding box used for detecting
3367
+ * symbol collisions.
3368
+ * Default `2`.
3369
+ * @default 2
3370
+ */
3371
+ padding?: number | Expression;
3330
3372
  /**
3331
3373
  * Specifies the orientation of the text when the map is pitched.
3332
3374
  * <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
@@ -3336,6 +3378,13 @@ declare namespace atlas {
3336
3378
  * @default "auto"
3337
3379
  */
3338
3380
  pitchAlignment?: "auto" | "map" | "viewport";
3381
+ /**
3382
+ * Radial offset of text, in the direction of the symbol's anchor. Useful in combination
3383
+ * with `variableAnchor`, which defaults to using the two-dimensional `offset` if present.
3384
+ * Default: `0`
3385
+ * @default 0
3386
+ */
3387
+ radialOffset?: number | Expression;
3339
3388
  /**
3340
3389
  * The amount to rotate the text clockwise in degrees.
3341
3390
  * Default `0`
@@ -3355,6 +3404,25 @@ declare namespace atlas {
3355
3404
  * @default "auto"
3356
3405
  */
3357
3406
  rotationAlignment?: "auto" | "map" | "viewport";
3407
+ /**
3408
+ * List of potential anchor locations, to increase the chance of placing high-priority
3409
+ * labels on the map. The renderer will attempt to place the label at each location,
3410
+ * in order, before moving onto the next label. Use `justify: "auto"` to choose text
3411
+ * justification based on anchor position. To apply an offset use the `radialOffset` or
3412
+ * two-dimensional `offset` options.
3413
+ * <p>`"center"`: The center of the icon is placed closest to the anchor.</p>
3414
+ * <p>`"left"`: The left side of the icon is placed closest to the anchor.</p>
3415
+ * <p>`"right"`: The right side of the icon is placed closest to the anchor.</p>
3416
+ * <p>`"top"`: The top of the icon is placed closest to the anchor.</p>
3417
+ * <p>`"bottom"`: The bottom of the icon is placed closest to the anchor.</p>
3418
+ * <p>`"top-left"`: The top left corner of the icon is placed closest to the anchor.</p>
3419
+ * <p>`"top-right"`: The top right corner of the icon is placed closest to the anchor.</p>
3420
+ * <p>`"bottom-left"`: The bottom left corner of the icon is placed closest to the anchor.</p>
3421
+ * <p>`"bottom-right"`: The bottom right corner of the icon is placed closest to the anchor.</p>
3422
+ * Default: `undefined`
3423
+ * @default undefined
3424
+ */
3425
+ variableAnchor?: ("center" | "left" | "right" | "top" | "bottom" | "top-left" | "top-right" | "bottom-left" | "bottom-right")[];
3358
3426
  /**
3359
3427
  * The size of the font in pixels.
3360
3428
  * Must be a number greater or equal to 0.
@@ -3489,6 +3557,11 @@ declare namespace atlas {
3489
3557
  * @default ControlStyle.light
3490
3558
  */
3491
3559
  style: ControlStyle;
3560
+ /**
3561
+ * Inverts the direction of map rotation controls.
3562
+ * @default false
3563
+ */
3564
+ inverted?: boolean;
3492
3565
  }
3493
3566
 
3494
3567
  /**
@@ -3507,6 +3580,11 @@ declare namespace atlas {
3507
3580
  * @default ControlStyle.light
3508
3581
  */
3509
3582
  style: ControlStyle;
3583
+ /**
3584
+ * Inverts the direction of map pitch controls.
3585
+ * @default false
3586
+ */
3587
+ inverted?: boolean;
3510
3588
  }
3511
3589
 
3512
3590
  /**
@@ -3544,6 +3622,11 @@ declare namespace atlas {
3544
3622
  * Default `true`
3545
3623
  */
3546
3624
  autoSelectionMode?: boolean;
3625
+ /**
3626
+ * theme
3627
+ * when unset - all styles are selectable
3628
+ */
3629
+ theme?: "auto" | string;
3547
3630
  }
3548
3631
 
3549
3632
  /**
@@ -3682,7 +3765,7 @@ declare namespace atlas {
3682
3765
  */
3683
3766
  centerOffset?: atlas.Pixel;
3684
3767
  /**
3685
- * The bearing of the map (rotation) in degrees.
3768
+ * The bearing of the map (rotation) in degrees.
3686
3769
  * When the bearing is 0, 90, 180, or 270 the top of the map container will be north, east, south or west respectively.
3687
3770
  * `default 0`
3688
3771
  * @default 0
@@ -4219,6 +4302,12 @@ declare namespace atlas {
4219
4302
  * @default true
4220
4303
  */
4221
4304
  touchInteraction?: boolean;
4305
+ /**
4306
+ * Whether touch rotation is enabled for touch devices. This option is not applied if touchInteraction is disabled.
4307
+ * default `true`
4308
+ * @default true
4309
+ */
4310
+ touchRotate?: boolean;
4222
4311
  /**
4223
4312
  * Sets the zoom rate of the mouse wheel
4224
4313
  * default `1/450`
@@ -4355,7 +4444,34 @@ declare namespace atlas {
4355
4444
  | 'SpriteJSON'
4356
4445
  | 'Image'
4357
4446
  | 'StyleDefinitions'
4358
- | 'Attribution';
4447
+ | 'Attribution'
4448
+ | 'Thumbnail';
4449
+
4450
+ /**
4451
+ * Represents the contents of the style set.
4452
+ */
4453
+ export interface StyleSet {
4454
+ created?: string;
4455
+ defaultStyle: string;
4456
+ description?: string;
4457
+ id?: string;
4458
+ styles: StyleSetStyle[];
4459
+ version?: number;
4460
+ }
4461
+
4462
+ /**
4463
+ * Represents the info for a single style.
4464
+ */
4465
+ export interface StyleSetStyle {
4466
+ copyright?: string;
4467
+ displayName?: string;
4468
+ name: string;
4469
+ shortcutKey?: string;
4470
+ style?: object;
4471
+ theme: string;
4472
+ thumbnail?: string;
4473
+ url?: string;
4474
+ }
4359
4475
 
4360
4476
  /**
4361
4477
  * Global properties used in all atlas service requests.
@@ -4381,12 +4497,24 @@ declare namespace atlas {
4381
4497
  * @default "atlas.microsoft.com"
4382
4498
  */
4383
4499
  domain?: string;
4500
+ /**
4501
+ * The style set of the map. Determines which styles are available to be picked
4502
+ * and what do they consist of (style names, thumbnails, URLs, etc).
4503
+ */
4504
+ styleSet?: StyleSet;
4384
4505
  /**
4385
4506
  * Enable accessibility
4386
4507
  * default: true
4387
4508
  * @default true
4388
4509
  */
4389
4510
  enableAccessibility?: boolean;
4511
+ /**
4512
+ * Enable fallback to geocoder for accessibility location, if failed to extract location from vector data.
4513
+ * default: true
4514
+ * @default true
4515
+ * @internal
4516
+ */
4517
+ enableAccessibilityLocationFallback?: boolean;
4390
4518
  /**
4391
4519
  * Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds.
4392
4520
  * This setting affects all symbol layers.
@@ -4395,7 +4523,7 @@ declare namespace atlas {
4395
4523
  */
4396
4524
  fadeDuration?: number;
4397
4525
  /**
4398
- * Defines a CSS font-family for locally overriding generation of glyphs in the
4526
+ * Defines a CSS font-family for locally overriding generation of glyphs in the
4399
4527
  * 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
4400
4528
  * In these ranges, font settings from the map's style will be ignored,
4401
4529
  * except for font-weight keywords (light/regular/medium/bold). Set to false,
@@ -4405,7 +4533,7 @@ declare namespace atlas {
4405
4533
  */
4406
4534
  localIdeographFontFamily?: string;
4407
4535
  /**
4408
- * Maximum number of images (raster tiles, sprites, icons) to load in parallel,
4536
+ * Maximum number of images (raster tiles, sprites, icons) to load in parallel,
4409
4537
  * which affects performance in raster-heavy maps. 16 by default.
4410
4538
  */
4411
4539
  maxParallelImageRequests?: number;
@@ -4559,6 +4687,12 @@ declare namespace atlas {
4559
4687
  * @param callback The event handler callback.
4560
4688
  */
4561
4689
  add(eventType: "stylechanged", callback: (e: StyleChangedEvent) => void): void;
4690
+ /**
4691
+ * Adds a styleset change event to the map.
4692
+ * @param eventType A styleset changed event name
4693
+ * @param callback The event handler callback
4694
+ */
4695
+ add(eventType: "stylesetchanged", callback: (e: StyleSet) => void): void;
4562
4696
  /**
4563
4697
  * Adds a wheel event to the map.
4564
4698
  * @param eventType The wheel event name.
@@ -4835,7 +4969,7 @@ declare namespace atlas {
4835
4969
  * @param eventType The event name.
4836
4970
  * @param callback The event handler callback.
4837
4971
  */
4838
- remove(eventType: string, callback: (e: void | atlas.layer.Layer | MapEvent | MapDataEvent | MapMouseEvent | MapTouchEvent | MapMouseWheelEvent | atlas.source.Source | string) => void): void;
4972
+ remove(eventType: string, callback: (e: void | atlas.layer.Layer | MapEvent | MapDataEvent | MapMouseEvent | MapTouchEvent | MapMouseWheelEvent | atlas.source.Source | string | StyleSet) => void): void;
4839
4973
  /**
4840
4974
  * Removes an event listener from the DataSource(s).
4841
4975
  * @param eventType The event name.
@@ -4919,6 +5053,26 @@ declare namespace atlas {
4919
5053
  clear(): void;
4920
5054
  }
4921
5055
 
5056
+ /**
5057
+ * Signature for the `options` parameter passed to `ImageSpriteManager.add`.
5058
+ */
5059
+ export type StyleImageMetadata = {
5060
+ /** Ratio of pixels in the image to physical pixels on the screen (default: 1) */
5061
+ pixelRatio?: number;
5062
+
5063
+ /** Whether the image should be interpreted as an SDF image (default: false) */
5064
+ sdf?: boolean;
5065
+
5066
+ /** [[x1, x2], ...] if icon-text-fit is used in a layer with this image, defines the part(s) that can be stretched horizontally */
5067
+ stretchX?: number[][];
5068
+
5069
+ /** [[y1, y2], ...] if icon-text-fit is used in a layer with this image, defines the part(s) that can be stretched vertically */
5070
+ stretchY?: number[][];
5071
+
5072
+ /** [x1, y1, x2, y2] if icon-text-fit is used in a layer with this image, defines the part of the image that can be covered by the content in text-field */
5073
+ content?: number[];
5074
+ };
5075
+
4922
5076
  /**
4923
5077
  * A manager for the map control's image sprite.
4924
5078
  * Exposed through the imageSprite property of the atlas.Map class.
@@ -4930,8 +5084,9 @@ declare namespace atlas {
4930
5084
  * @param id The image's id.
4931
5085
  * If the specified id matches the id of a previously added image the new image will be ignored.
4932
5086
  * @param icon The image to add to the map's sprite. Can be a data URI, inline SVG, or image URL.
5087
+ * @param meta Additional options that describe the image
4933
5088
  */
4934
- add(id: string, icon: string | HTMLImageElement | ImageData): Promise<void>;
5089
+ add(id: string, icon: string | HTMLImageElement | ImageData, meta?: StyleImageMetadata): Promise<void>;
4935
5090
  /**
4936
5091
  * Removes all images added by the user.
4937
5092
  */