azure-maps-control 2.3.5 → 2.3.6

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.3.5",
4
+ "version": "2.3.6",
5
5
  "description": "Map SDK for Azure Maps",
6
6
  "keywords": [
7
7
  "azure",
@@ -673,6 +673,38 @@ declare namespace atlas {
673
673
  private constructPitchIncrementButton;
674
674
  }
675
675
 
676
+ /**
677
+ * A control to display a scale bar on the map.
678
+ */
679
+ export class ScaleControl extends ControlBase {
680
+ private map: Map | null;
681
+ private control;
682
+
683
+ /**
684
+ * Constructs a ScaleControl.
685
+ * @param options The options for the control.
686
+ */
687
+ constructor(options?: ScaleControlOptions);
688
+ /**
689
+ * Initialization method for the control which is called when added to the map.
690
+ * @param map The map that the control will be added to.
691
+ * @param options The ControlOptions for this control.
692
+ * @return An HTMLElement to be placed on the map for the control.
693
+ */
694
+ onAdd(map: Map, options?: ControlOptions): HTMLElement;
695
+ /**
696
+ * Method that is called when the control is removed from the map. Should perform any necessary cleanup for the
697
+ * control.
698
+ */
699
+ onRemove(): void;
700
+
701
+ /**
702
+ * Set the scale's unit of the distance
703
+ * @param unit - Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
704
+ */
705
+ setUnit(unit: "imperial" | "metric" | "nautical"): void;
706
+ }
707
+
676
708
  /**
677
709
  * A control for changing the style of the map.
678
710
  */
@@ -3706,6 +3738,24 @@ declare namespace atlas {
3706
3738
  inverted?: boolean;
3707
3739
  }
3708
3740
 
3741
+ /**
3742
+ * The options for a ScaleControl object.
3743
+ */
3744
+ export interface ScaleControlOptions extends Options {
3745
+ /**
3746
+ * The maximum length of the scale control in pixels.
3747
+ * Default `100`.
3748
+ * @default 100
3749
+ */
3750
+ maxWidth?: number;
3751
+ /**
3752
+ * Unit of the distance (`'imperial'`, `'metric'` or `'nautical'`).
3753
+ * Default `'metric'`.
3754
+ * @default 'metric'
3755
+ */
3756
+ unit?: "imperial" | "metric" | "nautical";
3757
+ }
3758
+
3709
3759
  /**
3710
3760
  * The options for a StyleControl object.
3711
3761
  */
@@ -5459,6 +5509,29 @@ declare namespace atlas {
5459
5509
  * @param sourceLayer the layer where shapes and features are matched
5460
5510
  */
5461
5511
  getRenderedShapes(source: string | atlas.source.Source, filter?: Expression, sourceLayer?: string): Array<atlas.data.Feature<atlas.data.Geometry, any> | Shape>;
5512
+ /**
5513
+ * Gets the state of a feature
5514
+ * @param feature the ID of the feature
5515
+ * @param source the ID of the source
5516
+ * @param sourceLayer the ID of the layer
5517
+ */
5518
+ getFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, sourceLayer?: string): object;
5519
+ /**
5520
+ * Removes the state or a single key value of the state of a feature.
5521
+ * @param feature the ID of the feature
5522
+ * @param source the ID of the source
5523
+ * @param sourceLayer the ID of the layer
5524
+ * @param key the key in the feature state to update
5525
+ */
5526
+ removeFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, sourceLayer?: string, key?: string): void;
5527
+ /**
5528
+ * Sets the state of the feature by passing in a key value pair object.
5529
+ * @param feature the ID of the feature
5530
+ * @param source the ID of the source
5531
+ * @param sourceLayer the ID of the layer
5532
+ * @param key the key in the feature state to update
5533
+ */
5534
+ setFeatureState(feature: string | Shape | atlas.data.Feature<atlas.data.Geometry, any>, source: string | atlas.source.Source, state: object, sourceLayer?: string): void;
5462
5535
  /**
5463
5536
  * Removes all sources from the map.
5464
5537
  */