@nextgis/ngw-leaflet 1.11.10 → 1.13.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.
@@ -1,4 +1,4 @@
1
- /** Bundle of @nextgis/ngw-leaflet; version: 1.11.10; author: NextGIS */
1
+ /** Bundle of @nextgis/ngw-leaflet; version: 1.13.0; author: NextGIS */
2
2
  var NgwLeaflet = (function () {
3
3
  'use strict';
4
4
 
@@ -15399,6 +15399,9 @@ var NgwLeaflet = (function () {
15399
15399
 
15400
15400
  function isObject$1(val) {
15401
15401
  return Object.prototype.toString.call(val) === '[object Object]';
15402
+ }
15403
+ function isArray(val) {
15404
+ return Object.prototype.toString.call(val) === '[object Array]';
15402
15405
  }
15403
15406
 
15404
15407
  function fixUrlStr(url) {
@@ -16462,6 +16465,9 @@ var NgwLeaflet = (function () {
16462
16465
  'movestart',
16463
16466
  'move',
16464
16467
  'moveend',
16468
+ 'mousemove',
16469
+ 'mouseout',
16470
+ 'mouseover',
16465
16471
  ];
16466
16472
  if (opt && opt.include) {
16467
16473
  events = events.filter(function (x) { return opt.include.includes(x); });
@@ -16772,6 +16778,9 @@ var NgwLeaflet = (function () {
16772
16778
  _c.sent();
16773
16779
  _c.label = 11;
16774
16780
  case 11:
16781
+ if (options.onAdded) {
16782
+ options.onAdded(_adapter);
16783
+ }
16775
16784
  this._emitLayerEvent('layer:add', layerId, _adapter);
16776
16785
  return [2 /*return*/, _adapter];
16777
16786
  case 12: return [2 /*return*/, Promise.reject('No adapter')];
@@ -16912,8 +16921,15 @@ var NgwLeaflet = (function () {
16912
16921
  WebMapLayers.prototype.addTileLayer = function (url, options) {
16913
16922
  return this.addLayer('TILE', __assign(__assign({}, options), { url: url }));
16914
16923
  };
16915
- /** Shortcut for {@link WebMapLayers.addLayer} to create TileLayer adapter */
16916
- WebMapLayers.prototype.addImageLayer = function (url, options) {
16924
+ WebMapLayers.prototype.addImageLayer = function (urlOrOptions, options) {
16925
+ var url;
16926
+ if (typeof urlOrOptions === 'string') {
16927
+ url = urlOrOptions;
16928
+ }
16929
+ else {
16930
+ url = urlOrOptions.url;
16931
+ options = urlOrOptions;
16932
+ }
16917
16933
  return this.addLayer('IMAGE', __assign(__assign({}, options), { url: url }));
16918
16934
  };
16919
16935
  /**
@@ -18241,6 +18257,11 @@ var NgwLeaflet = (function () {
18241
18257
  xhr.abort();
18242
18258
  });
18243
18259
  }
18260
+ if (options.signal) {
18261
+ options.signal.addEventListener('abort', function () {
18262
+ xhr.abort();
18263
+ });
18264
+ }
18244
18265
  xhr.send(data);
18245
18266
  };
18246
18267
  }
@@ -18382,7 +18403,12 @@ var NgwLeaflet = (function () {
18382
18403
  forCache.id = resource;
18383
18404
  }
18384
18405
  else if (isObject(resource)) {
18385
- forCache.id = resource.id;
18406
+ if (resource.id !== undefined) {
18407
+ forCache.id = resource.id;
18408
+ }
18409
+ else if (resource.keyname) {
18410
+ forCache.keyname = resource.keyname;
18411
+ }
18386
18412
  }
18387
18413
  var makeRequest = function () {
18388
18414
  if (typeof resource === 'string') {
@@ -18484,20 +18510,35 @@ var NgwLeaflet = (function () {
18484
18510
  };
18485
18511
  ResourcesControl.prototype.getChildrenOf = function (resource, requestOptions) {
18486
18512
  var _this = this;
18487
- return this.getId(resource).then(function (parent) {
18488
- return _this.connector
18489
- .get('resource.collection', __assign({ cache: true }, requestOptions), {
18490
- parent: parent,
18491
- })
18492
- .then(function (items) {
18493
- for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
18494
- var i = items_1[_i];
18495
- _this.cache.add('resource.item', CancelablePromise.resolve(i), {
18496
- id: i.resource.id,
18497
- });
18513
+ return this.getIdOrFail(resource).then(function (parent) {
18514
+ return _this._getChildrenOf(parent, requestOptions);
18515
+ });
18516
+ };
18517
+ ResourcesControl.prototype._getChildrenOf = function (parent, requestOptions, _items) {
18518
+ var _this = this;
18519
+ if (_items === void 0) { _items = []; }
18520
+ return this.connector
18521
+ .get('resource.collection', __assign({ cache: true }, requestOptions), {
18522
+ parent: parent,
18523
+ })
18524
+ .then(function (items) {
18525
+ var recursivePromises = [];
18526
+ for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {
18527
+ var item = items_1[_i];
18528
+ _this.cache.add('resource.item', CancelablePromise.resolve(item), {
18529
+ id: item.resource.id,
18530
+ });
18531
+ _items.push(item);
18532
+ if ((requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.recursive) && item.resource.children) {
18533
+ recursivePromises.push(_this._getChildrenOf(item.resource.id, requestOptions, _items));
18498
18534
  }
18499
- return items;
18500
- });
18535
+ }
18536
+ if (recursivePromises.length) {
18537
+ return CancelablePromise.all(recursivePromises).then(function () {
18538
+ return _items;
18539
+ });
18540
+ }
18541
+ return _items;
18501
18542
  });
18502
18543
  };
18503
18544
  ResourcesControl.prototype.update = function (resource, data) {
@@ -19228,10 +19269,10 @@ var NgwLeaflet = (function () {
19228
19269
  function createGeoJsonFeature(item) {
19229
19270
  var geometry = item.geom;
19230
19271
  var feature = {
19272
+ geometry: geometry,
19231
19273
  id: item.id,
19232
19274
  type: 'Feature',
19233
19275
  properties: item.fields,
19234
- geometry: geometry,
19235
19276
  };
19236
19277
  return feature;
19237
19278
  }
@@ -19257,7 +19298,19 @@ var NgwLeaflet = (function () {
19257
19298
  function createFeatureFieldFilterQueries(opt) {
19258
19299
  var queries = getQueries(opt);
19259
19300
  return CancelablePromise.all(queries).then(function (itemsParts) {
19260
- var items = itemsParts.reduce(function (a, b) { return a.concat(b); }, []);
19301
+ // this list of ids used for optimization
19302
+ var ids = [];
19303
+ var items = [];
19304
+ for (var _i = 0, itemsParts_1 = itemsParts; _i < itemsParts_1.length; _i++) {
19305
+ var part = itemsParts_1[_i];
19306
+ for (var _a = 0, part_1 = part; _a < part_1.length; _a++) {
19307
+ var item = part_1[_a];
19308
+ if (!ids.includes(item.id)) {
19309
+ items.push(item);
19310
+ ids.push(item.id);
19311
+ }
19312
+ }
19313
+ }
19261
19314
  var offset = opt.offset !== undefined ? opt.offset : 0;
19262
19315
  var limit = opt.limit !== undefined ? opt.limit : items.length;
19263
19316
  if (opt.offset || opt.limit) {
@@ -19266,27 +19319,27 @@ var NgwLeaflet = (function () {
19266
19319
  return items;
19267
19320
  });
19268
19321
  }
19322
+ function createParam(pf) {
19323
+ var field = pf[0], operation = pf[1], value = pf[2];
19324
+ var isFldStr = field !== 'id' ? 'fld_' : '';
19325
+ var vStart = '';
19326
+ var vEnd = '';
19327
+ var field_ = String(field)
19328
+ .trim()
19329
+ .replace(/^(%?)(.+?)(%?)$/, function (m, a, b, c) {
19330
+ vStart = a;
19331
+ vEnd = c;
19332
+ return b;
19333
+ });
19334
+ var v = vStart + value + vEnd;
19335
+ return ["".concat(isFldStr).concat(field_, "__").concat(operation), v];
19336
+ }
19269
19337
  function getQueries(opt, _queries, _parentAllParams) {
19270
19338
  if (_queries === void 0) { _queries = []; }
19271
19339
  if (_parentAllParams === void 0) { _parentAllParams = []; }
19272
19340
  var filters = opt.filters;
19273
19341
  var logic = typeof filters[0] === 'string' ? filters[0] : 'all';
19274
19342
  var filters_ = filters.filter(function (x) { return Array.isArray(x); });
19275
- var createParam = function (pf) {
19276
- var field = pf[0], operation = pf[1], value = pf[2];
19277
- var isFldStr = field !== 'id' ? 'fld_' : '';
19278
- var vStart = '';
19279
- var vEnd = '';
19280
- var field_ = String(field)
19281
- .trim()
19282
- .replace(/^(%?)(.+?)(%?)$/, function (m, a, b, c) {
19283
- vStart = a;
19284
- vEnd = c;
19285
- return b;
19286
- });
19287
- var v = vStart + value + vEnd;
19288
- return ["".concat(isFldStr).concat(field_, "__").concat(operation), v];
19289
- };
19290
19343
  if (logic === 'any') {
19291
19344
  for (var _i = 0, filters_1 = filters_; _i < filters_1.length; _i++) {
19292
19345
  var f = filters_1[_i];
@@ -19332,7 +19385,7 @@ var NgwLeaflet = (function () {
19332
19385
  }
19333
19386
  function fetchNgwLayerItemsRequest(options) {
19334
19387
  var params = __assign({}, FEATURE_REQUEST_PARAMS);
19335
- var connector = options.connector, limit = options.limit, offset = options.offset, intersects = options.intersects, orderBy = options.orderBy, resourceId = options.resourceId, paramList = options.paramList;
19388
+ var limit = options.limit, offset = options.offset, orderBy = options.orderBy, paramList = options.paramList, connector = options.connector, intersects = options.intersects, resourceId = options.resourceId;
19336
19389
  if (limit) {
19337
19390
  if (limit !== Number.POSITIVE_INFINITY) {
19338
19391
  params.limit = limit;
@@ -19345,7 +19398,6 @@ var NgwLeaflet = (function () {
19345
19398
  if (offset) {
19346
19399
  params.offset = offset;
19347
19400
  }
19348
- // TODO: fix type for options
19349
19401
  updateItemRequestParam(params, options);
19350
19402
  if (orderBy) {
19351
19403
  params.order_by = orderBy.join(',');
@@ -19367,6 +19419,7 @@ var NgwLeaflet = (function () {
19367
19419
  }
19368
19420
 
19369
19421
  function prepareNgwFieldsToPropertiesFilter(fields) {
19422
+ console.log(fields);
19370
19423
  var f;
19371
19424
  var _loop_1 = function () {
19372
19425
  var field = fields[f];
@@ -19386,6 +19439,9 @@ var NgwLeaflet = (function () {
19386
19439
  fields[f] = new (Date.bind.apply(Date, __spreadArray([void 0], dt_1, false)))().toISOString();
19387
19440
  }
19388
19441
  }
19442
+ else if (f === 'id' && typeof field === 'string') {
19443
+ fields[f] = field.split(',').map(Number);
19444
+ }
19389
19445
  };
19390
19446
  for (f in fields) {
19391
19447
  _loop_1();
@@ -19398,7 +19454,7 @@ var NgwLeaflet = (function () {
19398
19454
  if (filters) {
19399
19455
  return createFeatureFieldFilterQueries(__assign(__assign({}, options), { filters: filters })).then(function (data) {
19400
19456
  var _a;
19401
- var clientFilterValidate = (_a = options.clientFilterValidate) !== null && _a !== void 0 ? _a : true;
19457
+ var clientFilterValidate = (_a = options.clientFilterValidate) !== null && _a !== void 0 ? _a : isFilterWithAnyCase(filters);
19402
19458
  // Additional client-side filter check
19403
19459
  if (clientFilterValidate) {
19404
19460
  data = data.filter(function (y) {
@@ -19413,6 +19469,21 @@ var NgwLeaflet = (function () {
19413
19469
  else {
19414
19470
  return fetchNgwLayerItemsRequest(options);
19415
19471
  }
19472
+ }
19473
+ function isFilterWithAnyCase(filters) {
19474
+ if (filters[0] === 'any') {
19475
+ return true;
19476
+ }
19477
+ for (var i = 1; i < filters.length; i++) {
19478
+ var p = filters[i];
19479
+ if (isArray(p)) {
19480
+ var deep = isFilterWithAnyCase(p);
19481
+ if (deep) {
19482
+ return true;
19483
+ }
19484
+ }
19485
+ }
19486
+ return false;
19416
19487
  }
19417
19488
 
19418
19489
  function fetchNgwLayerFeatures(options) {
@@ -19765,6 +19836,26 @@ var NgwLeaflet = (function () {
19765
19836
  });
19766
19837
  }
19767
19838
 
19839
+ function getImageAdapterOptions(_a) {
19840
+ var resourceId = _a.resourceId, baseUrl = _a.baseUrl, nd = _a.nd, headers = _a.headers;
19841
+ var url = baseUrl + '/api/component/render/image';
19842
+ var params = { resource: resourceId };
19843
+ if (nd) {
19844
+ params.nd = nd;
19845
+ }
19846
+ return {
19847
+ url: url,
19848
+ resourceId: resourceId,
19849
+ headers: headers,
19850
+ params: params,
19851
+ updateWmsParams: function (params_) {
19852
+ if (nd) {
19853
+ params_.nd = nd;
19854
+ }
19855
+ return updateImageParams(params_, resourceId);
19856
+ },
19857
+ };
19858
+ }
19768
19859
  function ngwApiToAdapterOptions(_a) {
19769
19860
  var options = _a.options, webMap = _a.webMap, baseUrl = _a.baseUrl;
19770
19861
  var adapter = options.adapter || 'IMAGE';
@@ -19776,16 +19867,12 @@ var NgwLeaflet = (function () {
19776
19867
  if (typeof resourceId === 'number') {
19777
19868
  if (adapter === 'IMAGE') {
19778
19869
  if (isImageAllowed) {
19779
- url = baseUrl + '/api/component/render/image';
19780
- return {
19781
- url: url,
19870
+ return getImageAdapterOptions({
19782
19871
  resourceId: resourceId,
19783
19872
  headers: options.headers,
19784
- params: { resource: resourceId, nd: nd },
19785
- updateWmsParams: function (params) {
19786
- return updateImageParams(__assign({ nd: nd }, params), resourceId);
19787
- },
19788
- };
19873
+ nd: nd,
19874
+ baseUrl: baseUrl,
19875
+ });
19789
19876
  }
19790
19877
  else {
19791
19878
  adapter = 'TILE';
@@ -21200,6 +21287,7 @@ var NgwLeaflet = (function () {
21200
21287
  NgwWebmapLayerAdapter.prototype._setBasemaps = function (baseWebmap) {
21201
21288
  var _this = this;
21202
21289
  var webMap = this.options.webMap;
21290
+ // to avoid set many basemaps on init
21203
21291
  var enabledAlreadySet = false;
21204
21292
  var _loop_1 = function (x) {
21205
21293
  createOnFirstShowNgwAdapter({
@@ -21208,9 +21296,11 @@ var NgwLeaflet = (function () {
21208
21296
  item: x,
21209
21297
  adapterOptions: { crossOrigin: this_1.options.crossOrigin },
21210
21298
  }).then(function (adapter) {
21211
- // to avoid set many basemaps on init
21212
21299
  var visibility = enabledAlreadySet ? false : x.enabled;
21213
- webMap
21300
+ if (x.enabled) {
21301
+ enabledAlreadySet = true;
21302
+ }
21303
+ return webMap
21214
21304
  .addBaseLayer(adapter, {
21215
21305
  id: WEBMAP_BASELAYER_ID_PREFIX + x.resource_id,
21216
21306
  name: x.display_name,
@@ -21220,9 +21310,6 @@ var NgwLeaflet = (function () {
21220
21310
  .then(function (l) {
21221
21311
  l.id && _this._webmapBaselayersIds.push(l.id);
21222
21312
  });
21223
- if (x.enabled) {
21224
- enabledAlreadySet = true;
21225
- }
21226
21313
  });
21227
21314
  };
21228
21315
  var this_1 = this;
@@ -21704,7 +21791,7 @@ var NgwLeaflet = (function () {
21704
21791
  function updateImageParams(params, resourceId) {
21705
21792
  var bbox = params.bbox, width = params.width, height = params.height, nd = params.nd;
21706
21793
  return {
21707
- resource: resourceId,
21794
+ resource: Array.isArray(resourceId) ? resourceId.join(',') : resourceId,
21708
21795
  extent: bbox,
21709
21796
  size: width + ',' + height,
21710
21797
  timestamp: Date.now(),
@@ -21946,7 +22033,6 @@ var NgwLeaflet = (function () {
21946
22033
 
21947
22034
  function getIdentifyItems(identify, multiple) {
21948
22035
  if (multiple === void 0) { multiple = false; }
21949
- var params;
21950
22036
  var resources = [];
21951
22037
  var paramsList = [];
21952
22038
  for (var l in identify) {
@@ -21967,14 +22053,9 @@ var NgwLeaflet = (function () {
21967
22053
  if ('features' in identifyItem) {
21968
22054
  var layerFeatures = identifyItem.features;
21969
22055
  var resourceId = Number(l);
21970
- var feature = layerFeatures[0];
21971
- if (feature) {
21972
- params = {
21973
- featureId: feature.id,
21974
- resourceId: resourceId,
21975
- feature: feature,
21976
- };
21977
- paramsList.push(params);
22056
+ var featureParams = createParamsFromFeatures(layerFeatures, resourceId, multiple);
22057
+ if (featureParams.length) {
22058
+ paramsList.push.apply(paramsList, featureParams);
21978
22059
  if (!multiple) {
21979
22060
  break;
21980
22061
  }
@@ -21983,6 +22064,22 @@ var NgwLeaflet = (function () {
21983
22064
  }
21984
22065
  return paramsList;
21985
22066
  }
22067
+ function createParamsFromFeatures(features, resourceId, multiple) {
22068
+ var featureParams = [];
22069
+ for (var _i = 0, features_1 = features; _i < features_1.length; _i++) {
22070
+ var feature = features_1[_i];
22071
+ var params = {
22072
+ featureId: feature.id,
22073
+ resourceId: resourceId,
22074
+ feature: feature,
22075
+ };
22076
+ featureParams.push(params);
22077
+ if (!multiple) {
22078
+ break;
22079
+ }
22080
+ }
22081
+ return featureParams;
22082
+ }
21986
22083
  function fetchIdentifyGeoJson(options) {
21987
22084
  var connector = options.connector, identify = options.identify;
21988
22085
  for (var l in identify) {
@@ -22012,38 +22109,45 @@ var NgwLeaflet = (function () {
22012
22109
  }
22013
22110
  return CancelablePromise.resolve(undefined);
22014
22111
  }
22015
- function sendIdentifyRequest(ev, options) {
22016
- deprecatedMapClick(ev);
22017
- var _a = ev.lngLat, lng = _a[0], lat = _a[1];
22112
+ function featureLayerIdentify(options) {
22113
+ var g = options.geom;
22018
22114
  var geom = [];
22019
- if (options.geom) {
22020
- var polygon_1 = options.geom.type === 'Feature'
22021
- ? options.geom.geometry
22022
- : options.geom.type === 'Polygon'
22023
- ? options.geom
22024
- : false;
22025
- if (polygon_1) {
22026
- geom = polygon_1.coordinates[0];
22115
+ if (Array.isArray(g)) {
22116
+ geom = g;
22117
+ }
22118
+ else {
22119
+ var polygon = g.type === 'Feature' ? g.geometry : g.type === 'Polygon' ? g : false;
22120
+ if (polygon) {
22121
+ geom = polygon.coordinates[0];
22027
22122
  }
22028
22123
  }
22029
- if (!geom.length) {
22030
- geom = getCirclePolygonCoordinates(lng, lat, options.radius);
22124
+ if (geom) {
22125
+ // create wkt string
22126
+ var polygonStr = [];
22127
+ for (var _i = 0, geom_1 = geom; _i < geom_1.length; _i++) {
22128
+ var _a = geom_1[_i], lng = _a[0], lat = _a[1];
22129
+ var _b = degrees2meters(lng, lat), x = _b[0], y = _b[1];
22130
+ polygonStr.push(x + ' ' + y);
22131
+ }
22132
+ var wkt = "POLYGON((".concat(polygonStr.join(', '), "))");
22133
+ var layers = options.layers;
22134
+ var data = {
22135
+ geom: wkt,
22136
+ srs: 3857,
22137
+ layers: layers,
22138
+ };
22139
+ return options.connector.post('feature_layer.identify', { data: data });
22031
22140
  }
22032
- // create wkt string
22033
- var polygon = [];
22034
- geom.forEach(function (_a) {
22035
- var lng = _a[0], lat = _a[1];
22036
- var _b = degrees2meters(lng, lat), x = _b[0], y = _b[1];
22037
- polygon.push(x + ' ' + y);
22038
- });
22039
- var wkt = "POLYGON((".concat(polygon.join(', '), "))");
22040
- var layers = options.layers;
22041
- var data = {
22042
- geom: wkt,
22043
- srs: 3857,
22044
- layers: layers,
22045
- };
22046
- return options.connector.post('feature_layer.identify', { data: data });
22141
+ else {
22142
+ throw new Error('Not valid geometry format to make intersection');
22143
+ }
22144
+ }
22145
+ function sendIdentifyRequest(ev, options) {
22146
+ var _a;
22147
+ deprecatedMapClick(ev);
22148
+ var _b = ev.lngLat, lng = _b[0], lat = _b[1];
22149
+ var geom = (_a = options.geom) !== null && _a !== void 0 ? _a : getCirclePolygonCoordinates(lng, lat, options.radius);
22150
+ return featureLayerIdentify(__assign(__assign({}, options), { geom: geom }));
22047
22151
  }
22048
22152
  function createIdentifyItem(opt) {
22049
22153
  return new IdentifyItem(opt);
@@ -22929,6 +23033,9 @@ var NgwLeaflet = (function () {
22929
23033
  link.title = title;
22930
23034
  link.setAttribute('role', 'button');
22931
23035
  link.setAttribute('aria-label', title);
23036
+ if (options.addClass) {
23037
+ link.classList.add(options.addClass);
23038
+ }
22932
23039
  leafletSrc.exports.DomEvent.disableClickPropagation(link);
22933
23040
  leafletSrc.exports.DomEvent.on(link, 'click', leafletSrc.exports.DomEvent.stop);
22934
23041
  if (options.html instanceof HTMLElement) {
@@ -24200,18 +24307,25 @@ var NgwLeaflet = (function () {
24200
24307
  this._universalEvents = [
24201
24308
  'move',
24202
24309
  'zoom',
24203
- 'moveend',
24204
24310
  'zoomend',
24205
24311
  'zoomstart',
24312
+ 'moveend',
24206
24313
  'movestart',
24207
24314
  ];
24315
+ this._positionEvents = [
24316
+ 'mousemove',
24317
+ 'mouseout',
24318
+ 'mouseover',
24319
+ ];
24208
24320
  }
24209
24321
  LeafletMapAdapter.prototype.create = function (options) {
24210
24322
  var _this = this;
24211
24323
  this.options = __assign({}, options);
24212
24324
  if (this.options.target) {
24213
24325
  var _a = this.options, zoom = _a.zoom, center = _a.center, maxZoom = _a.maxZoom, minZoom = _a.minZoom, mb = _a.maxBounds, mapAdapterOptions = _a.mapAdapterOptions;
24214
- 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));
24326
+ this.map =
24327
+ this.options.map ||
24328
+ 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));
24215
24329
  // create default pane
24216
24330
  var defPane = this.map.createPane('order-0');
24217
24331
  this.map._addUnselectCb = function (def) {
@@ -24457,9 +24571,22 @@ var NgwLeaflet = (function () {
24457
24571
  map.on('click', function (evt) {
24458
24572
  _this.onMapClick(evt);
24459
24573
  });
24460
- this._universalEvents.forEach(function (e) {
24574
+ var _loop_1 = function (e) {
24461
24575
  map.on(e, function () { return _this.emitter.emit(e, _this); }, map);
24462
- });
24576
+ };
24577
+ for (var _i = 0, _a = this._universalEvents; _i < _a.length; _i++) {
24578
+ var e = _a[_i];
24579
+ _loop_1(e);
24580
+ }
24581
+ var _loop_2 = function (e) {
24582
+ map.on(e, function (evt) {
24583
+ return _this.emitter.emit(e, convertMapClickEvent(evt));
24584
+ }, map);
24585
+ };
24586
+ for (var _b = 0, _c = this._positionEvents; _b < _c.length; _b++) {
24587
+ var e = _c[_b];
24588
+ _loop_2(e);
24589
+ }
24463
24590
  }
24464
24591
  };
24465
24592
  LeafletMapAdapter.layerAdapters = {