@opengeoweb/webmap 2.8.0 → 2.9.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/index.esm.js CHANGED
@@ -1,6 +1,6 @@
1
+ import { debounce, throttle } from 'throttle-debounce';
1
2
  import moment from 'moment';
2
3
  import proj4 from 'proj4';
3
- import { debounce, throttle } from 'throttle-debounce';
4
4
 
5
5
  function _typeof(obj) {
6
6
  "@babel/helpers - typeof";
@@ -4204,6 +4204,8 @@ var WMJSMap = /*#__PURE__*/function () {
4204
4204
  this._mapPanStart = this._mapPanStart.bind(this);
4205
4205
  this._mapPan = this._mapPan.bind(this);
4206
4206
  this._mapPanEnd = this._mapPanEnd.bind(this);
4207
+ this.mapPanPercentage = this.mapPanPercentage.bind(this);
4208
+ this._mapPanPercentageEnd = debounce(500, this._mapPanPercentageEnd);
4207
4209
  this._mapZoomStart = this._mapZoomStart.bind(this);
4208
4210
  this._mapZoom = this._mapZoom.bind(this);
4209
4211
  this._mapZoomEnd = this._mapZoomEnd.bind(this);
@@ -6306,6 +6308,7 @@ var WMJSMap = /*#__PURE__*/function () {
6306
6308
  }, {
6307
6309
  key: "_mapPanStart",
6308
6310
  value: function _mapPanStart(x, y) {
6311
+ this.zoomTo(this.updateBBOX);
6309
6312
  this.wMFlyToBBox.flyZoomToBBOXStop();
6310
6313
  this.baseDiv.style.cursor = 'move';
6311
6314
 
@@ -6374,6 +6377,37 @@ var WMJSMap = /*#__PURE__*/function () {
6374
6377
  this.draw('mapPanEnd');
6375
6378
  }
6376
6379
  }, {
6380
+ key: "mapPanPercentage",
6381
+ value: function mapPanPercentage(percentageDiffX, percentageDiffY) {
6382
+ var _this$updateBBOX = this.updateBBOX,
6383
+ left = _this$updateBBOX.left,
6384
+ bottom = _this$updateBBOX.bottom,
6385
+ right = _this$updateBBOX.right,
6386
+ top = _this$updateBBOX.top;
6387
+
6388
+ if (percentageDiffX !== 0) {
6389
+ var diffX = percentageDiffX * Math.abs(left - right);
6390
+ this.updateBBOX.left = left - diffX;
6391
+ this.updateBBOX.right = right - diffX;
6392
+ }
6393
+
6394
+ if (percentageDiffY !== 0) {
6395
+ var diffY = percentageDiffY * Math.abs(top - bottom);
6396
+ this.updateBBOX.bottom = bottom - diffY;
6397
+ this.updateBBOX.top = top - diffY;
6398
+ }
6399
+
6400
+ this._updateBoundingBox(this.updateBBOX);
6401
+
6402
+ this._mapPanPercentageEnd();
6403
+ }
6404
+ }, {
6405
+ key: "_mapPanPercentageEnd",
6406
+ value: function _mapPanPercentageEnd() {
6407
+ this.zoomTo(this.updateBBOX);
6408
+ this.draw('mapPanEnd');
6409
+ }
6410
+ }, {
6377
6411
  key: "_mapZoomStart",
6378
6412
  value: function _mapZoomStart() {
6379
6413
  this.baseDiv.style.cursor = 'crosshair';
@@ -7620,6 +7654,12 @@ rootNode, path) {
7620
7654
 
7621
7655
  sortByKey(rootNode, 'text');
7622
7656
  };
7657
+ var generatedServiceIds = 0;
7658
+
7659
+ var generateWMJSServiceId = function generateWMJSServiceId() {
7660
+ generatedServiceIds += 1;
7661
+ return "serviceid_".concat(generatedServiceIds);
7662
+ };
7623
7663
  /**
7624
7664
  * WMJSService Class
7625
7665
  *
@@ -7628,11 +7668,14 @@ rootNode, path) {
7628
7668
  * title (optional)
7629
7669
  */
7630
7670
 
7671
+
7631
7672
  var WMJSService = /*#__PURE__*/function () {
7632
7673
  function WMJSService(options) {
7633
7674
  _classCallCheck(this, WMJSService);
7634
7675
 
7676
+ this.id = undefined;
7635
7677
  this.service = undefined;
7678
+ this.id = generateWMJSServiceId();
7636
7679
  this.service = undefined;
7637
7680
  this.title = undefined;
7638
7681
  this.onlineresource = undefined;
package/index.umd.js CHANGED
@@ -1,8 +1,8 @@
1
1
  (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('moment'), require('proj4'), require('throttle-debounce')) :
3
- typeof define === 'function' && define.amd ? define(['exports', 'moment', 'proj4', 'throttle-debounce'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Webmap = {}, global.moment, global.proj4, global.throttleDebounce));
5
- })(this, (function (exports, moment, proj4, throttleDebounce) { 'use strict';
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('throttle-debounce'), require('moment'), require('proj4')) :
3
+ typeof define === 'function' && define.amd ? define(['exports', 'throttle-debounce', 'moment', 'proj4'], factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.Webmap = {}, global.throttleDebounce, global.moment, global.proj4));
5
+ })(this, (function (exports, throttleDebounce, moment, proj4) { 'use strict';
6
6
 
7
7
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
8
 
@@ -4260,6 +4260,8 @@
4260
4260
  this._mapPanStart = this._mapPanStart.bind(this);
4261
4261
  this._mapPan = this._mapPan.bind(this);
4262
4262
  this._mapPanEnd = this._mapPanEnd.bind(this);
4263
+ this.mapPanPercentage = this.mapPanPercentage.bind(this);
4264
+ this._mapPanPercentageEnd = throttleDebounce.debounce(500, this._mapPanPercentageEnd);
4263
4265
  this._mapZoomStart = this._mapZoomStart.bind(this);
4264
4266
  this._mapZoom = this._mapZoom.bind(this);
4265
4267
  this._mapZoomEnd = this._mapZoomEnd.bind(this);
@@ -6271,6 +6273,7 @@
6271
6273
 
6272
6274
 
6273
6275
  WMJSMap.prototype._mapPanStart = function (x, y) {
6276
+ this.zoomTo(this.updateBBOX);
6274
6277
  this.wMFlyToBBox.flyZoomToBBOXStop();
6275
6278
  this.baseDiv.style.cursor = 'move';
6276
6279
 
@@ -6337,6 +6340,35 @@
6337
6340
  this.draw('mapPanEnd');
6338
6341
  };
6339
6342
 
6343
+ WMJSMap.prototype.mapPanPercentage = function (percentageDiffX, percentageDiffY) {
6344
+ var _a = this.updateBBOX,
6345
+ left = _a.left,
6346
+ bottom = _a.bottom,
6347
+ right = _a.right,
6348
+ top = _a.top;
6349
+
6350
+ if (percentageDiffX !== 0) {
6351
+ var diffX = percentageDiffX * Math.abs(left - right);
6352
+ this.updateBBOX.left = left - diffX;
6353
+ this.updateBBOX.right = right - diffX;
6354
+ }
6355
+
6356
+ if (percentageDiffY !== 0) {
6357
+ var diffY = percentageDiffY * Math.abs(top - bottom);
6358
+ this.updateBBOX.bottom = bottom - diffY;
6359
+ this.updateBBOX.top = top - diffY;
6360
+ }
6361
+
6362
+ this._updateBoundingBox(this.updateBBOX);
6363
+
6364
+ this._mapPanPercentageEnd();
6365
+ };
6366
+
6367
+ WMJSMap.prototype._mapPanPercentageEnd = function () {
6368
+ this.zoomTo(this.updateBBOX);
6369
+ this.draw('mapPanEnd');
6370
+ };
6371
+
6340
6372
  WMJSMap.prototype._mapZoomStart = function () {
6341
6373
  this.baseDiv.style.cursor = 'crosshair';
6342
6374
  this.mapZooming = 1;
@@ -7587,6 +7619,12 @@
7587
7619
 
7588
7620
  sortByKey(rootNode, 'text');
7589
7621
  };
7622
+ var generatedServiceIds = 0;
7623
+
7624
+ var generateWMJSServiceId = function generateWMJSServiceId() {
7625
+ generatedServiceIds += 1;
7626
+ return "serviceid_" + generatedServiceIds;
7627
+ };
7590
7628
  /**
7591
7629
  * WMJSService Class
7592
7630
  *
@@ -7595,11 +7633,14 @@
7595
7633
  * title (optional)
7596
7634
  */
7597
7635
 
7636
+
7598
7637
  var WMJSService =
7599
7638
  /** @class */
7600
7639
  function () {
7601
7640
  function WMJSService(options) {
7641
+ this.id = undefined;
7602
7642
  this.service = undefined;
7643
+ this.id = generateWMJSServiceId();
7603
7644
  this.service = undefined;
7604
7645
  this.title = undefined;
7605
7646
  this.onlineresource = undefined;
@@ -243,6 +243,8 @@ export default class WMJSMap {
243
243
  _mapPanStart(x: number, y: number): void;
244
244
  _mapPan(x: number, y: number): void;
245
245
  _mapPanEnd(x: number, y: number): void;
246
+ mapPanPercentage(percentageDiffX: number, percentageDiffY: number): void;
247
+ _mapPanPercentageEnd(): void;
246
248
  _mapZoomStart(): void;
247
249
  _mapZoom(): void;
248
250
  _mapZoomEnd(): void;
@@ -37,6 +37,7 @@ export declare const recursivelyFindLayer: (layers: any[], rootNode: any[], path
37
37
  * title (optional)
38
38
  */
39
39
  export declare class WMJSService {
40
+ id: string;
40
41
  service: string;
41
42
  title: string;
42
43
  onlineresource: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "2.8.0",
3
+ "version": "2.9.0",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {