azure-maps-control 2.1.8 → 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/dist/atlas-core-bare.js +27743 -0
- package/dist/atlas-core-bare.min.js +55 -0
- package/dist/atlas-core.js +9213 -8788
- package/dist/atlas-core.min.js +1 -1
- package/dist/atlas.css +29 -0
- package/dist/atlas.js +5346 -4921
- package/dist/atlas.min.css +1 -1
- package/dist/atlas.min.js +1 -1
- package/package.json +1 -1
- package/typings/index.d.ts +201 -20
package/package.json
CHANGED
package/typings/index.d.ts
CHANGED
|
@@ -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.
|
|
@@ -1536,6 +1536,16 @@ declare namespace atlas {
|
|
|
1536
1536
|
* @returns An array of position objects that form a regular polygon.
|
|
1537
1537
|
*/
|
|
1538
1538
|
export function getRegularPolygonPath(origin: atlas.data.Position | atlas.data.Point, radius: number, numberOfPositions: number, units?: string | DistanceUnits, offset?: number): atlas.data.Position[];
|
|
1539
|
+
/**
|
|
1540
|
+
* Calculates an array of position objects that are an equal distance away from a central point to create a regular polygon broken by antimeridian into multiple sub-paths.
|
|
1541
|
+
* @param origin Center of the regular polygon.
|
|
1542
|
+
* @param radius Radius of the regular polygon.
|
|
1543
|
+
* @param numberOfPositions Number of positions the polygon should have.
|
|
1544
|
+
* @param units Unit of distance measurement. Default is meters.
|
|
1545
|
+
* @param offset An offset to rotate the polygon. When 0 the first position will align with North.
|
|
1546
|
+
* @returns An array of paths that form a regular polygon. Comparing to getRegularPolygonPath, sub-paths will always contain longitude in -180 to 180 range
|
|
1547
|
+
*/
|
|
1548
|
+
export function getRegularPolygonPaths(origin: Position | atlas.data.Point, radius: number, numberOfPositions: number, units?: string | DistanceUnits, offset?: number): Position[][]
|
|
1539
1549
|
/**
|
|
1540
1550
|
* Calculates a position object that is a fractional distance between two position objects.
|
|
1541
1551
|
* @param origin First position to calculate mid-point between.
|
|
@@ -1807,10 +1817,26 @@ declare namespace atlas {
|
|
|
1807
1817
|
/**
|
|
1808
1818
|
* Perform a Douglas-Peucker simplification on an array of positions or pixels.
|
|
1809
1819
|
* @param points The position or pixel points to simplify.
|
|
1810
|
-
* @param tolerance A tolerance to use in the simplification.
|
|
1811
|
-
* @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.
|
|
1812
1822
|
*/
|
|
1813
1823
|
export function simplify(points: (Position | Pixel)[], tolerance: number): (Position | Pixel)[];
|
|
1824
|
+
|
|
1825
|
+
/**
|
|
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
|
+
* See getPathSplitByAntimeridian when this is not desired.
|
|
1828
|
+
* @param path Array of position objects or linestring to denormalize
|
|
1829
|
+
* @returns A denormalized array of position objects, path crossing antimeridian will contain longitude outside of -180 to 180 range.
|
|
1830
|
+
*/
|
|
1831
|
+
export function getPathDenormalizedAtAntimerian(path: atlas.data.LineString | Position[]): Position[];
|
|
1832
|
+
|
|
1833
|
+
/**
|
|
1834
|
+
* Split path on antimeridian into multiple paths.
|
|
1835
|
+
* See getPathDenormalizedAtAntimerian when this is not desired.
|
|
1836
|
+
* @param path Array of position objects or linestring to split
|
|
1837
|
+
* @returns A path split into multiple paths by antimeridian.
|
|
1838
|
+
*/
|
|
1839
|
+
export function getPathSplitByAntimeridian(path: atlas.data.LineString | Position[]): Position[][];
|
|
1814
1840
|
}
|
|
1815
1841
|
|
|
1816
1842
|
/**
|
|
@@ -1818,7 +1844,6 @@ declare namespace atlas {
|
|
|
1818
1844
|
*/
|
|
1819
1845
|
export class Map {
|
|
1820
1846
|
private readonly styleLayerIds;
|
|
1821
|
-
private readonly styleSourceIds;
|
|
1822
1847
|
private readonly map;
|
|
1823
1848
|
private localizedStringsPromise;
|
|
1824
1849
|
private insights;
|
|
@@ -2587,7 +2612,7 @@ declare namespace atlas {
|
|
|
2587
2612
|
*/
|
|
2588
2613
|
export function setLanguage(language: string): void;
|
|
2589
2614
|
/**
|
|
2590
|
-
* 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,
|
|
2591
2616
|
* which affects performance in raster-heavy maps. 16 by default.
|
|
2592
2617
|
* @param maxParallelImageRequests Maximum number of images to load in parallel.
|
|
2593
2618
|
*/
|
|
@@ -2795,6 +2820,12 @@ declare namespace atlas {
|
|
|
2795
2820
|
* @default false
|
|
2796
2821
|
*/
|
|
2797
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;
|
|
2798
2829
|
/**
|
|
2799
2830
|
* Specifies the orientation of the icon when the map is pitched.
|
|
2800
2831
|
* <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
|
|
@@ -2885,15 +2916,15 @@ declare namespace atlas {
|
|
|
2885
2916
|
sourceLayer?: string;
|
|
2886
2917
|
|
|
2887
2918
|
/**
|
|
2888
|
-
* Specifies the color gradient used to colorize the pixels in the heatmap.
|
|
2889
|
-
* 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.
|
|
2890
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"]`
|
|
2891
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"]`
|
|
2892
2923
|
*/
|
|
2893
2924
|
color?: Expression;
|
|
2894
2925
|
|
|
2895
2926
|
/**
|
|
2896
|
-
* Similar to `heatmap-weight` but specifies the global heatmap intensity.
|
|
2927
|
+
* Similar to `heatmap-weight` but specifies the global heatmap intensity.
|
|
2897
2928
|
* The higher this value is, the more ‘weight’ each point will contribute to the appearance.
|
|
2898
2929
|
* Default `1`
|
|
2899
2930
|
* @default 1
|
|
@@ -2908,7 +2939,7 @@ declare namespace atlas {
|
|
|
2908
2939
|
opacity?: number | Expression;
|
|
2909
2940
|
|
|
2910
2941
|
/**
|
|
2911
|
-
* 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.
|
|
2912
2943
|
* The radius must be a number greater or equal to 1.
|
|
2913
2944
|
* Default `30`.
|
|
2914
2945
|
* @default 30
|
|
@@ -2916,9 +2947,9 @@ declare namespace atlas {
|
|
|
2916
2947
|
radius?: number | Expression;
|
|
2917
2948
|
|
|
2918
2949
|
/**
|
|
2919
|
-
* Specifies how much an individual data point contributes to the heatmap.
|
|
2920
|
-
* 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.
|
|
2921
|
-
* 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.
|
|
2922
2953
|
* Default `1`
|
|
2923
2954
|
* @default 1
|
|
2924
2955
|
*/
|
|
@@ -3228,6 +3259,26 @@ declare namespace atlas {
|
|
|
3228
3259
|
* @default "point"
|
|
3229
3260
|
*/
|
|
3230
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";
|
|
3231
3282
|
/**
|
|
3232
3283
|
* Distance in pixels between two symbol anchors along a line. Must be greater or equal to 1.
|
|
3233
3284
|
* Default `250`.
|
|
@@ -3286,6 +3337,16 @@ declare namespace atlas {
|
|
|
3286
3337
|
* @default false
|
|
3287
3338
|
*/
|
|
3288
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";
|
|
3289
3350
|
/**
|
|
3290
3351
|
* Specifies an offset distance of the icon from its anchor in ems.
|
|
3291
3352
|
* Positive values indicate right and down, while negative values indicate left and up.
|
|
@@ -3301,6 +3362,13 @@ declare namespace atlas {
|
|
|
3301
3362
|
* @default false
|
|
3302
3363
|
*/
|
|
3303
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;
|
|
3304
3372
|
/**
|
|
3305
3373
|
* Specifies the orientation of the text when the map is pitched.
|
|
3306
3374
|
* <p>`"auto"`: Automatically matches the value of `rotationAlignment`.</p>
|
|
@@ -3310,6 +3378,13 @@ declare namespace atlas {
|
|
|
3310
3378
|
* @default "auto"
|
|
3311
3379
|
*/
|
|
3312
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;
|
|
3313
3388
|
/**
|
|
3314
3389
|
* The amount to rotate the text clockwise in degrees.
|
|
3315
3390
|
* Default `0`
|
|
@@ -3329,6 +3404,25 @@ declare namespace atlas {
|
|
|
3329
3404
|
* @default "auto"
|
|
3330
3405
|
*/
|
|
3331
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")[];
|
|
3332
3426
|
/**
|
|
3333
3427
|
* The size of the font in pixels.
|
|
3334
3428
|
* Must be a number greater or equal to 0.
|
|
@@ -3463,6 +3557,11 @@ declare namespace atlas {
|
|
|
3463
3557
|
* @default ControlStyle.light
|
|
3464
3558
|
*/
|
|
3465
3559
|
style: ControlStyle;
|
|
3560
|
+
/**
|
|
3561
|
+
* Inverts the direction of map rotation controls.
|
|
3562
|
+
* @default false
|
|
3563
|
+
*/
|
|
3564
|
+
inverted?: boolean;
|
|
3466
3565
|
}
|
|
3467
3566
|
|
|
3468
3567
|
/**
|
|
@@ -3481,6 +3580,11 @@ declare namespace atlas {
|
|
|
3481
3580
|
* @default ControlStyle.light
|
|
3482
3581
|
*/
|
|
3483
3582
|
style: ControlStyle;
|
|
3583
|
+
/**
|
|
3584
|
+
* Inverts the direction of map pitch controls.
|
|
3585
|
+
* @default false
|
|
3586
|
+
*/
|
|
3587
|
+
inverted?: boolean;
|
|
3484
3588
|
}
|
|
3485
3589
|
|
|
3486
3590
|
/**
|
|
@@ -3518,6 +3622,11 @@ declare namespace atlas {
|
|
|
3518
3622
|
* Default `true`
|
|
3519
3623
|
*/
|
|
3520
3624
|
autoSelectionMode?: boolean;
|
|
3625
|
+
/**
|
|
3626
|
+
* theme
|
|
3627
|
+
* when unset - all styles are selectable
|
|
3628
|
+
*/
|
|
3629
|
+
theme?: "auto" | string;
|
|
3521
3630
|
}
|
|
3522
3631
|
|
|
3523
3632
|
/**
|
|
@@ -3656,7 +3765,7 @@ declare namespace atlas {
|
|
|
3656
3765
|
*/
|
|
3657
3766
|
centerOffset?: atlas.Pixel;
|
|
3658
3767
|
/**
|
|
3659
|
-
* The bearing of the map (rotation) in degrees.
|
|
3768
|
+
* The bearing of the map (rotation) in degrees.
|
|
3660
3769
|
* When the bearing is 0, 90, 180, or 270 the top of the map container will be north, east, south or west respectively.
|
|
3661
3770
|
* `default 0`
|
|
3662
3771
|
* @default 0
|
|
@@ -4193,6 +4302,12 @@ declare namespace atlas {
|
|
|
4193
4302
|
* @default true
|
|
4194
4303
|
*/
|
|
4195
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;
|
|
4196
4311
|
/**
|
|
4197
4312
|
* Sets the zoom rate of the mouse wheel
|
|
4198
4313
|
* default `1/450`
|
|
@@ -4329,7 +4444,34 @@ declare namespace atlas {
|
|
|
4329
4444
|
| 'SpriteJSON'
|
|
4330
4445
|
| 'Image'
|
|
4331
4446
|
| 'StyleDefinitions'
|
|
4332
|
-
| '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
|
+
}
|
|
4333
4475
|
|
|
4334
4476
|
/**
|
|
4335
4477
|
* Global properties used in all atlas service requests.
|
|
@@ -4355,12 +4497,24 @@ declare namespace atlas {
|
|
|
4355
4497
|
* @default "atlas.microsoft.com"
|
|
4356
4498
|
*/
|
|
4357
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;
|
|
4358
4505
|
/**
|
|
4359
4506
|
* Enable accessibility
|
|
4360
4507
|
* default: true
|
|
4361
4508
|
* @default true
|
|
4362
4509
|
*/
|
|
4363
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;
|
|
4364
4518
|
/**
|
|
4365
4519
|
* Controls the duration of the fade-in/fade-out animation for label collisions, in milliseconds.
|
|
4366
4520
|
* This setting affects all symbol layers.
|
|
@@ -4369,7 +4523,7 @@ declare namespace atlas {
|
|
|
4369
4523
|
*/
|
|
4370
4524
|
fadeDuration?: number;
|
|
4371
4525
|
/**
|
|
4372
|
-
* 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
|
|
4373
4527
|
* 'CJK Unified Ideographs', 'Hiragana', 'Katakana' and 'Hangul Syllables' ranges.
|
|
4374
4528
|
* In these ranges, font settings from the map's style will be ignored,
|
|
4375
4529
|
* except for font-weight keywords (light/regular/medium/bold). Set to false,
|
|
@@ -4379,7 +4533,7 @@ declare namespace atlas {
|
|
|
4379
4533
|
*/
|
|
4380
4534
|
localIdeographFontFamily?: string;
|
|
4381
4535
|
/**
|
|
4382
|
-
* 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,
|
|
4383
4537
|
* which affects performance in raster-heavy maps. 16 by default.
|
|
4384
4538
|
*/
|
|
4385
4539
|
maxParallelImageRequests?: number;
|
|
@@ -4533,6 +4687,12 @@ declare namespace atlas {
|
|
|
4533
4687
|
* @param callback The event handler callback.
|
|
4534
4688
|
*/
|
|
4535
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;
|
|
4536
4696
|
/**
|
|
4537
4697
|
* Adds a wheel event to the map.
|
|
4538
4698
|
* @param eventType The wheel event name.
|
|
@@ -4809,7 +4969,7 @@ declare namespace atlas {
|
|
|
4809
4969
|
* @param eventType The event name.
|
|
4810
4970
|
* @param callback The event handler callback.
|
|
4811
4971
|
*/
|
|
4812
|
-
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;
|
|
4813
4973
|
/**
|
|
4814
4974
|
* Removes an event listener from the DataSource(s).
|
|
4815
4975
|
* @param eventType The event name.
|
|
@@ -4893,6 +5053,26 @@ declare namespace atlas {
|
|
|
4893
5053
|
clear(): void;
|
|
4894
5054
|
}
|
|
4895
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
|
+
|
|
4896
5076
|
/**
|
|
4897
5077
|
* A manager for the map control's image sprite.
|
|
4898
5078
|
* Exposed through the imageSprite property of the atlas.Map class.
|
|
@@ -4904,8 +5084,9 @@ declare namespace atlas {
|
|
|
4904
5084
|
* @param id The image's id.
|
|
4905
5085
|
* If the specified id matches the id of a previously added image the new image will be ignored.
|
|
4906
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
|
|
4907
5088
|
*/
|
|
4908
|
-
add(id: string, icon: string | HTMLImageElement | ImageData): Promise<void>;
|
|
5089
|
+
add(id: string, icon: string | HTMLImageElement | ImageData, meta?: StyleImageMetadata): Promise<void>;
|
|
4909
5090
|
/**
|
|
4910
5091
|
* Removes all images added by the user.
|
|
4911
5092
|
*/
|