azure-maps-control 3.0.2 → 3.1.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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "azure-maps-control",
3
3
  "author": "Microsoft Corporation",
4
- "version": "3.0.2",
4
+ "version": "3.1.0",
5
5
  "description": "Map SDK for Azure Maps",
6
6
  "keywords": [
7
7
  "azure",
@@ -40,31 +40,31 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@mapbox/mapbox-gl-rtl-text": "^0.2.3",
43
- "@microsoft/applicationinsights-web": "^3.0.0",
44
- "@playwright/test": "^1.36.2",
45
- "@rollup/plugin-commonjs": "^25.0.3",
43
+ "@microsoft/applicationinsights-web": "^3.0.2",
44
+ "@playwright/test": "^1.40.0",
45
+ "@rollup/plugin-commonjs": "^25.0.4",
46
46
  "@rollup/plugin-json": "^6.0.0",
47
47
  "@rollup/plugin-node-resolve": "^15.1.0",
48
- "@testing-library/dom": "^9.3.0",
48
+ "@testing-library/dom": "^9.3.1",
49
49
  "@turf/intersect": "^6.3.0",
50
- "@types/jest": "^29.0.0",
50
+ "@types/jest": "^29.5.3",
51
51
  "@types/jwt-decode": "^3.0.0",
52
- "@types/lodash": "4.14.197",
52
+ "@types/lodash": "4.14.202",
53
53
  "@typescript-eslint/eslint-plugin": "^6.4.0",
54
54
  "@typescript-eslint/parser": "^6.4.0",
55
55
  "atob": "^2.1.2",
56
- "azuremaps-maplibre-gl": "^3.3.0",
56
+ "azuremaps-maplibre-gl": "^3.6.1",
57
57
  "canvas": "^2.10.2",
58
- "es-abstract": "^1.20.1",
59
- "eslint": "^8.39.0",
58
+ "es-abstract": "^1.22.1",
59
+ "eslint": "^8.47.0",
60
60
  "eslint-plugin-security": "^1.5.0",
61
61
  "estree-walker": "^3.0.0",
62
62
  "fs-extra": "^11.0.0",
63
63
  "gl": "^6.0.1",
64
64
  "glob": "^10.0.0",
65
65
  "grunt": "^1.6.1",
66
- "jest": "^29.0.0",
67
- "jest-environment-jsdom": "^29.6.1",
66
+ "jest": "^29.7.0",
67
+ "jest-environment-jsdom": "^29.7.0",
68
68
  "jest-trx-results-processor": "^3.0.1",
69
69
  "jwt-decode": "^3.0.0",
70
70
  "less": "^4.2.0",
@@ -85,6 +85,7 @@
85
85
  "yargs": "^17.7.2"
86
86
  },
87
87
  "overrides": {
88
+ "@babel/core": "7.23.3",
88
89
  "rollup": "^3.28.0"
89
90
  },
90
91
  "license": "SEE LICENSE IN LICENSE.TXT",
@@ -94,5 +95,6 @@
94
95
  "thirdpartynotices.txt"
95
96
  ],
96
97
  "types": "./typings/index.d.ts",
97
- "main": "./dist/atlas.min.js"
98
+ "main": "./dist/atlas.min.js",
99
+ "module": "./dist/atlas-esm.min.js"
98
100
  }
Binary file
@@ -699,6 +699,38 @@ declare namespace atlas {
699
699
  protected constructPitchIncrementButton: (map: Map) => HTMLElement;
700
700
  }
701
701
 
702
+ /**
703
+ * A control to display a scale bar on the map.
704
+ */
705
+ export class ScaleControl extends ControlBase {
706
+ private map: Map | null;
707
+ private control;
708
+
709
+ /**
710
+ * Constructs a ScaleControl.
711
+ * @param options The options for the control.
712
+ */
713
+ constructor(options?: ScaleControlOptions);
714
+ /**
715
+ * Initialization method for the control which is called when added to the map.
716
+ * @param map The map that the control will be added to.
717
+ * @param options The ControlOptions for this control.
718
+ * @return An HTMLElement to be placed on the map for the control.
719
+ */
720
+ onAdd(map: Map, options?: ControlOptions): HTMLElement;
721
+ /**
722
+ * Method that is called when the control is removed from the map. Should perform any necessary cleanup for the
723
+ * control.
724
+ */
725
+ onRemove(): void;
726
+
727
+ /**
728
+ * Set the scale's unit of the distance
729
+ * @param unit - Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
730
+ */
731
+ setUnit(unit: "imperial" | "metric" | "nautical"): void;
732
+ }
733
+
702
734
  /**
703
735
  * A control for changing the style of the map.
704
736
  */
@@ -1127,6 +1159,8 @@ declare namespace atlas {
1127
1159
 
1128
1160
  /**
1129
1161
  * Sets the options of the polygon layer.
1162
+ * When `fillPattern` is set, `fillColor` will be ignored.
1163
+ * To set `fillColor`, make sure `fillPattern` is set to `undefined`.
1130
1164
  * @param newOptions The new options of the polygon layer.
1131
1165
  */
1132
1166
  setOptions(options: PolygonLayerOptions): void;
@@ -3772,6 +3806,24 @@ declare namespace atlas {
3772
3806
  inverted?: boolean;
3773
3807
  }
3774
3808
 
3809
+ /**
3810
+ * The options for a ScaleControl object.
3811
+ */
3812
+ export interface ScaleControlOptions extends Options {
3813
+ /**
3814
+ * The maximum length of the scale control in pixels.
3815
+ * Default `100`.
3816
+ * @default 100
3817
+ */
3818
+ maxWidth?: number;
3819
+ /**
3820
+ * Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
3821
+ * Default `'metric'`.
3822
+ * @default 'metric'
3823
+ */
3824
+ unit?: "imperial" | "metric" | "nautical";
3825
+ }
3826
+
3775
3827
  /**
3776
3828
  * The options for a StyleControl object.
3777
3829
  */
@@ -4773,8 +4825,8 @@ declare namespace atlas {
4773
4825
  */
4774
4826
  styleAPIVersion?: string;
4775
4827
  /**
4776
- * Enable accessibility
4777
- * default: true
4828
+ * Enable the accessibility feature to provide screen reader support for users who have difficulty visualizing the web application.
4829
+ * This property is set to true by default.
4778
4830
  * @default true
4779
4831
  */
4780
4832
  enableAccessibility?: boolean;
@@ -5575,6 +5627,29 @@ declare namespace atlas {
5575
5627
  * @param sourceLayer the layer where shapes and features are matched
5576
5628
  */
5577
5629
  getRenderedShapes(source: string | atlas.source.Source, filter?: Expression, sourceLayer?: string): Array<atlas.data.Feature<atlas.data.Geometry, any> | Shape>;
5630
+ /**
5631
+ * Gets the state of a feature
5632
+ * @param feature the ID of the feature
5633
+ * @param source the ID of the source
5634
+ * @param sourceLayer the ID of the layer
5635
+ */
5636
+ getFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, sourceLayer?: string): object;
5637
+ /**
5638
+ * Removes the state or a single key value of the state of a feature.
5639
+ * @param feature the ID of the feature
5640
+ * @param source the ID of the source
5641
+ * @param sourceLayer the ID of the layer
5642
+ * @param key the key in the feature state to update
5643
+ */
5644
+ removeFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, sourceLayer?: string, key?: string): void;
5645
+ /**
5646
+ * Sets the state of the feature by passing in a key value pair object.
5647
+ * @param feature the ID of the feature
5648
+ * @param source the ID of the source
5649
+ * @param sourceLayer the ID of the layer
5650
+ * @param key the key in the feature state to update
5651
+ */
5652
+ setFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, state: object, sourceLayer?: string): void;
5578
5653
  /**
5579
5654
  * Removes all sources from the map.
5580
5655
  */