@nextgis/leaflet-map-adapter 1.12.0 → 1.13.2

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/lib/index.d.ts CHANGED
@@ -35,7 +35,7 @@ declare class LeafletMapAdapter implements MapAdapter<Map_2, any, Control> {
35
35
  ATTRIBUTION: typeof AttributionControl;
36
36
  };
37
37
  static Map: typeof Map_2;
38
- options: MapOptions;
38
+ options: MapOptions<Map_2>;
39
39
  layerAdapters: {
40
40
  [name: string]: Type<LayerAdapter<Map_2, any, any>>;
41
41
  };
@@ -48,7 +48,8 @@ declare class LeafletMapAdapter implements MapAdapter<Map_2, any, Control> {
48
48
  private _resizeObserver?;
49
49
  private _unselectCb;
50
50
  private _universalEvents;
51
- create(options: MapOptions): void;
51
+ private _positionEvents;
52
+ create(options: MapOptions<Map_2>): void;
52
53
  destroy(): void;
53
54
  getContainer(): HTMLElement | undefined;
54
55
  getControlContainer(): HTMLElement;
@@ -61,9 +62,9 @@ declare class LeafletMapAdapter implements MapAdapter<Map_2, any, Control> {
61
62
  getZoom(): number | undefined;
62
63
  getBounds(): LngLatBoundsArray | undefined;
63
64
  fitBounds(bounds: LngLatBoundsArray, options?: FitOptions): void;
64
- getLayerAdapter(name: string): Type<LayerAdapter<L.Map, any, any>>;
65
- createControl(control: MapControl, options: CreateControlOptions): L.Control;
66
- createButtonControl(options: ButtonControlOptions): L.Control;
65
+ getLayerAdapter(name: string): Type<LayerAdapter<Map_2, any, any>>;
66
+ createControl(control: MapControl, options: CreateControlOptions): Control;
67
+ createButtonControl(options: ButtonControlOptions): Control;
67
68
  addControl(control: Control, position: string): Control | undefined;
68
69
  removeControl(control: Control): void;
69
70
  removeLayer(layer: Layer): void;
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/leaflet-map-adapter; version: 1.12.0; author: NextGIS */
1
+ /** Bundle of @nextgis/leaflet-map-adapter; version: 1.13.2; author: NextGIS */
2
2
  /*! *****************************************************************************
3
3
  Copyright (c) Microsoft Corporation.
4
4
 
@@ -16025,18 +16025,25 @@ var LeafletMapAdapter$1 = /** @class */ (function () {
16025
16025
  this._universalEvents = [
16026
16026
  'move',
16027
16027
  'zoom',
16028
- 'moveend',
16029
16028
  'zoomend',
16030
16029
  'zoomstart',
16030
+ 'moveend',
16031
16031
  'movestart',
16032
16032
  ];
16033
+ this._positionEvents = [
16034
+ 'mousemove',
16035
+ 'mouseout',
16036
+ 'mouseover',
16037
+ ];
16033
16038
  }
16034
16039
  LeafletMapAdapter.prototype.create = function (options) {
16035
16040
  var _this = this;
16036
16041
  this.options = __assign({}, options);
16037
16042
  if (this.options.target) {
16038
16043
  var _a = this.options, zoom = _a.zoom, center = _a.center, maxZoom = _a.maxZoom, minZoom = _a.minZoom, mb = _a.maxBounds, mapAdapterOptions = _a.mapAdapterOptions;
16039
- this.map = new leafletSrc.exports.Map(this.options.target, __assign({ attributionControl: false, zoomControl: false, maxBounds: mb ? arrayToBoundsExpression(mb) : undefined, maxZoom: maxZoom, minZoom: minZoom, center: center && [center[1], center[0]], zoom: zoom }, mapAdapterOptions));
16044
+ this.map =
16045
+ this.options.map ||
16046
+ new leafletSrc.exports.Map(this.options.target, __assign({ attributionControl: false, zoomControl: false, maxBounds: mb ? arrayToBoundsExpression(mb) : undefined, maxZoom: maxZoom, minZoom: minZoom, center: center && [center[1], center[0]], zoom: zoom }, mapAdapterOptions));
16040
16047
  // create default pane
16041
16048
  var defPane = this.map.createPane('order-0');
16042
16049
  this.map._addUnselectCb = function (def) {
@@ -16282,9 +16289,22 @@ var LeafletMapAdapter$1 = /** @class */ (function () {
16282
16289
  map.on('click', function (evt) {
16283
16290
  _this.onMapClick(evt);
16284
16291
  });
16285
- this._universalEvents.forEach(function (e) {
16292
+ var _loop_1 = function (e) {
16286
16293
  map.on(e, function () { return _this.emitter.emit(e, _this); }, map);
16287
- });
16294
+ };
16295
+ for (var _i = 0, _a = this._universalEvents; _i < _a.length; _i++) {
16296
+ var e = _a[_i];
16297
+ _loop_1(e);
16298
+ }
16299
+ var _loop_2 = function (e) {
16300
+ map.on(e, function (evt) {
16301
+ return _this.emitter.emit(e, convertMapClickEvent(evt));
16302
+ }, map);
16303
+ };
16304
+ for (var _b = 0, _c = this._positionEvents; _b < _c.length; _b++) {
16305
+ var e = _c[_b];
16306
+ _loop_2(e);
16307
+ }
16288
16308
  }
16289
16309
  };
16290
16310
  LeafletMapAdapter.layerAdapters = {