@nextgis/leaflet-map-adapter 3.0.0-alpha.18 → 3.0.0-alpha.20

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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/leaflet-map-adapter; version: 3.0.0-alpha.17; author: NextGIS */
1
+ /** Bundle of @nextgis/leaflet-map-adapter; version: 3.0.0-alpha.20; author: NextGIS */
2
2
  import { EventEmitter } from 'events';
3
3
  import { Control, DomEvent, GeoJSON, DivIcon, Marker, CircleMarker, FeatureGroup, ImageOverlay as ImageOverlay$1, Layer, Util, CRS, GridLayer, DomUtil, TileLayer as TileLayer$1, Map, latLngBounds, latLng } from 'leaflet';
4
4
  import { defined, debounce as debounce$1, isObject, updateUrlParams } from '@nextgis/utils';
@@ -1164,7 +1164,6 @@ var __defNormalProp$5 = (obj, key, value) => key in obj ? __defProp$5(obj, key,
1164
1164
  var __publicField$2 = (obj, key, value) => __defNormalProp$5(obj, typeof key !== "symbol" ? key + "" : key, value);
1165
1165
  class ImageLayer extends Layer {
1166
1166
  constructor(url, options) {
1167
- var _a;
1168
1167
  super(options);
1169
1168
  __publicField$2(this, "defaultWmsParams", {
1170
1169
  service: "WMS",
@@ -1199,18 +1198,21 @@ class ImageLayer extends Layer {
1199
1198
  const opts = {};
1200
1199
  let opt;
1201
1200
  for (opt in options) {
1201
+ const val = options[opt];
1202
1202
  if (opt in this.options) {
1203
- opts[opt] = options[opt];
1204
- } else if (!isObject(options[opt])) {
1205
- params[opt] = options[opt];
1203
+ opts[opt] = val;
1204
+ }
1205
+ }
1206
+ if (options.params) {
1207
+ for (const param in options.params) {
1208
+ const val = options.params[param];
1209
+ if (!isObject(val) && !Array.isArray(val) && typeof val !== "function") {
1210
+ params[param] = val;
1211
+ }
1206
1212
  }
1207
1213
  }
1208
1214
  Util.setOptions(this, opts);
1209
- this.wmsParams = Util.extend(
1210
- {},
1211
- this.defaultWmsParams,
1212
- (_a = params == null ? void 0 : params.params) != null ? _a : {}
1213
- );
1215
+ this.wmsParams = Util.extend({}, this.defaultWmsParams, params);
1214
1216
  }
1215
1217
  setParams(params) {
1216
1218
  Util.extend(this.wmsParams, params);