geojs 1.13.1 → 1.14.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/geo.js CHANGED
@@ -18195,11 +18195,13 @@ var _map2 = function map(arg) {
18195
18195
  * option when determining the new view.
18196
18196
  * @param {boolean} [ignoreClampBounds] If `true`, ignore the clampBounds
18197
18197
  * option when determining the new view.
18198
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan or zoom
18199
+ * event. If 'pan', only trigger the zoom event.
18198
18200
  * @returns {number|this}
18199
18201
  * @fires geo.event.zoom
18200
18202
  * @fires geo.event.pan
18201
18203
  */
18202
- this.zoom = function (val, origin, ignoreDiscreteZoom, ignoreClampBounds) {
18204
+ this.zoom = function (val, origin, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
18203
18205
  if (val === undefined) {
18204
18206
  return m_zoom;
18205
18207
  }
@@ -18224,22 +18226,52 @@ var _map2 = function map(arg) {
18224
18226
  zoomLevel: m_zoom,
18225
18227
  screenPosition: origin ? origin.map : undefined
18226
18228
  };
18227
- m_this.geoTrigger(geo_event.zoom, evt);
18229
+ if (!noTrigger || noTrigger === 'pan') {
18230
+ m_this.geoTrigger(geo_event.zoom, evt);
18231
+ }
18228
18232
  if (aroundPoint) {
18229
18233
  var shifted = m_this.gcsToDisplay(origin.mapgcs || origin.geo, origin.mapgcs ? null : undefined);
18230
18234
  m_this.pan({
18231
18235
  x: origin.map.x - shifted.x,
18232
18236
  y: origin.map.y - shifted.y
18233
- }, ignoreDiscreteZoom, true);
18237
+ }, ignoreDiscreteZoom, true, noTrigger);
18234
18238
  } else {
18235
18239
  m_this.pan({
18236
18240
  x: 0,
18237
18241
  y: 0
18238
- }, ignoreDiscreteZoom, ignoreClampBounds);
18242
+ }, ignoreDiscreteZoom, ignoreClampBounds, noTrigger);
18239
18243
  }
18240
18244
  return m_this;
18241
18245
  };
18242
18246
 
18247
+ /**
18248
+ * Set zoom level and center of the map.
18249
+ *
18250
+ * @param {number} zoom The new zoom level to set.
18251
+ * @param {geo.geoPosition} center The new center of the
18252
+ * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
18253
+ * gcs, `null` to use the map gcs, or any other transform. The center is
18254
+ * converted from this gcs to the map projection.
18255
+ * @param {geo.geoPosition} origin.geo The gcs coordinates of the zoom
18256
+ * center.
18257
+ * @param {geo.screenPosition} origin.map The display coordinates of the zoom
18258
+ * center.
18259
+ * @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the discreteZoom
18260
+ * option when determining the new view.
18261
+ * @param {boolean} [ignoreClampBounds] If `true`, ignore the clampBounds
18262
+ * option when determining the new view.
18263
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan or zoom
18264
+ * event.
18265
+ * @returns {this}
18266
+ * @fires geo.event.zoom
18267
+ * @fires geo.event.pan
18268
+ */
18269
+ this.zoomAndCenter = function (zoom, center, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
18270
+ this.zoom(zoom, undefined, ignoreDiscreteZoom, ignoreClampBounds, noTrigger || 'pan');
18271
+ this.center(center, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger);
18272
+ return this;
18273
+ };
18274
+
18243
18275
  /**
18244
18276
  * Pan the map by a number of display pixels.
18245
18277
  *
@@ -18253,10 +18285,11 @@ var _map2 = function map(arg) {
18253
18285
  * view. When `'limited'`, the `clampBoundsX` and `clampBoundsY` options
18254
18286
  * are selectively enforced so that the map will not end up more out of
18255
18287
  * bounds than its current state.
18288
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan event.
18256
18289
  * @returns {this}
18257
18290
  * @fires geo.event.pan
18258
18291
  */
18259
- this.pan = function (delta, ignoreDiscreteZoom, ignoreClampBounds) {
18292
+ this.pan = function (delta, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
18260
18293
  var evt = {
18261
18294
  screenDelta: delta
18262
18295
  };
@@ -18297,7 +18330,9 @@ var _map2 = function map(arg) {
18297
18330
  x: m_width / 2,
18298
18331
  y: m_height / 2
18299
18332
  });
18300
- m_this.geoTrigger(geo_event.pan, evt);
18333
+ if (!noTrigger) {
18334
+ m_this.geoTrigger(geo_event.pan, evt);
18335
+ }
18301
18336
  m_this.modified();
18302
18337
  return m_this;
18303
18338
  };
@@ -18359,7 +18394,7 @@ var _map2 = function map(arg) {
18359
18394
  /**
18360
18395
  * Get or set the center of the map in the given geographic coordinates.
18361
18396
  *
18362
- * @param {geo.geoPosition} coordinates If specified, the new center of the
18397
+ * @param {geo.geoPosition} [coordinates] If specified, the new center of the
18363
18398
  * map.
18364
18399
  * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
18365
18400
  * gcs, `null` to use the map gcs, or any other transform. If setting the
@@ -18372,10 +18407,11 @@ var _map2 = function map(arg) {
18372
18407
  * view. When `'limited'`, the `clampBoundsX` and `clampBoundsY` options
18373
18408
  * are selectively enforced so that the map will not end up more out of
18374
18409
  * bounds than its current state.
18410
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan event.
18375
18411
  * @returns {geo.geoPosition|this}
18376
18412
  * @fires geo.event.pan
18377
18413
  */
18378
- this.center = function (coordinates, gcs, ignoreDiscreteZoom, ignoreClampBounds) {
18414
+ this.center = function (coordinates, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
18379
18415
  var center;
18380
18416
  if (coordinates === undefined) {
18381
18417
  center = Object.assign({}, m_this.worldToGcs(m_center, gcs));
@@ -18387,12 +18423,14 @@ var _map2 = function map(arg) {
18387
18423
  camera_bounds(m_this.boundsFromZoomAndCenter(m_zoom, center, m_rotation, null, ignoreDiscreteZoom, ignoreClampBounds), m_rotation);
18388
18424
  m_this.modified();
18389
18425
  // trigger a pan event
18390
- m_this.geoTrigger(geo_event.pan, {
18391
- screenDelta: {
18392
- x: 0,
18393
- y: 0
18394
- }
18395
- });
18426
+ if (!noTrigger) {
18427
+ m_this.geoTrigger(geo_event.pan, {
18428
+ screenDelta: {
18429
+ x: 0,
18430
+ y: 0
18431
+ }
18432
+ });
18433
+ }
18396
18434
  return m_this;
18397
18435
  };
18398
18436
 
@@ -19151,7 +19189,7 @@ var _map2 = function map(arg) {
19151
19189
 
19152
19190
  // This might have consequences in terms of bounds/zoom clamping.
19153
19191
  // What behavior do we expect from this method in that case?
19154
- m_this.zoom(nav.zoom);
19192
+ m_this.zoom(nav.zoom, undefined, undefined, undefined, 'pan');
19155
19193
  m_this.center(nav.center, null);
19156
19194
  }
19157
19195
  return m_this.boundsFromZoomAndCenter(m_zoom, m_center, m_rotation, gcs, true);
@@ -28126,7 +28164,7 @@ module.exports = _sceneObject;
28126
28164
  * @constant
28127
28165
  * @type {string}
28128
28166
  */
28129
- module.exports = "9174d2af787e4421e022dca6933c5ee848294c1a";
28167
+ module.exports = "43f61353e44a71f669a4f0d631f102a517605fe9";
28130
28168
 
28131
28169
  /***/ }),
28132
28170
 
@@ -40011,7 +40049,7 @@ module.exports = _vectorFeature;
40011
40049
  * @constant
40012
40050
  * @type {string}
40013
40051
  */
40014
- module.exports = "1.13.1";
40052
+ module.exports = "1.14.0";
40015
40053
 
40016
40054
  /***/ }),
40017
40055
 
package/geo.lean.js CHANGED
@@ -15194,11 +15194,13 @@ var _map2 = function map(arg) {
15194
15194
  * option when determining the new view.
15195
15195
  * @param {boolean} [ignoreClampBounds] If `true`, ignore the clampBounds
15196
15196
  * option when determining the new view.
15197
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan or zoom
15198
+ * event. If 'pan', only trigger the zoom event.
15197
15199
  * @returns {number|this}
15198
15200
  * @fires geo.event.zoom
15199
15201
  * @fires geo.event.pan
15200
15202
  */
15201
- this.zoom = function (val, origin, ignoreDiscreteZoom, ignoreClampBounds) {
15203
+ this.zoom = function (val, origin, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
15202
15204
  if (val === undefined) {
15203
15205
  return m_zoom;
15204
15206
  }
@@ -15223,22 +15225,52 @@ var _map2 = function map(arg) {
15223
15225
  zoomLevel: m_zoom,
15224
15226
  screenPosition: origin ? origin.map : undefined
15225
15227
  };
15226
- m_this.geoTrigger(geo_event.zoom, evt);
15228
+ if (!noTrigger || noTrigger === 'pan') {
15229
+ m_this.geoTrigger(geo_event.zoom, evt);
15230
+ }
15227
15231
  if (aroundPoint) {
15228
15232
  var shifted = m_this.gcsToDisplay(origin.mapgcs || origin.geo, origin.mapgcs ? null : undefined);
15229
15233
  m_this.pan({
15230
15234
  x: origin.map.x - shifted.x,
15231
15235
  y: origin.map.y - shifted.y
15232
- }, ignoreDiscreteZoom, true);
15236
+ }, ignoreDiscreteZoom, true, noTrigger);
15233
15237
  } else {
15234
15238
  m_this.pan({
15235
15239
  x: 0,
15236
15240
  y: 0
15237
- }, ignoreDiscreteZoom, ignoreClampBounds);
15241
+ }, ignoreDiscreteZoom, ignoreClampBounds, noTrigger);
15238
15242
  }
15239
15243
  return m_this;
15240
15244
  };
15241
15245
 
15246
+ /**
15247
+ * Set zoom level and center of the map.
15248
+ *
15249
+ * @param {number} zoom The new zoom level to set.
15250
+ * @param {geo.geoPosition} center The new center of the
15251
+ * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
15252
+ * gcs, `null` to use the map gcs, or any other transform. The center is
15253
+ * converted from this gcs to the map projection.
15254
+ * @param {geo.geoPosition} origin.geo The gcs coordinates of the zoom
15255
+ * center.
15256
+ * @param {geo.screenPosition} origin.map The display coordinates of the zoom
15257
+ * center.
15258
+ * @param {boolean} [ignoreDiscreteZoom] If `true`, ignore the discreteZoom
15259
+ * option when determining the new view.
15260
+ * @param {boolean} [ignoreClampBounds] If `true`, ignore the clampBounds
15261
+ * option when determining the new view.
15262
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan or zoom
15263
+ * event.
15264
+ * @returns {this}
15265
+ * @fires geo.event.zoom
15266
+ * @fires geo.event.pan
15267
+ */
15268
+ this.zoomAndCenter = function (zoom, center, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
15269
+ this.zoom(zoom, undefined, ignoreDiscreteZoom, ignoreClampBounds, noTrigger || 'pan');
15270
+ this.center(center, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger);
15271
+ return this;
15272
+ };
15273
+
15242
15274
  /**
15243
15275
  * Pan the map by a number of display pixels.
15244
15276
  *
@@ -15252,10 +15284,11 @@ var _map2 = function map(arg) {
15252
15284
  * view. When `'limited'`, the `clampBoundsX` and `clampBoundsY` options
15253
15285
  * are selectively enforced so that the map will not end up more out of
15254
15286
  * bounds than its current state.
15287
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan event.
15255
15288
  * @returns {this}
15256
15289
  * @fires geo.event.pan
15257
15290
  */
15258
- this.pan = function (delta, ignoreDiscreteZoom, ignoreClampBounds) {
15291
+ this.pan = function (delta, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
15259
15292
  var evt = {
15260
15293
  screenDelta: delta
15261
15294
  };
@@ -15296,7 +15329,9 @@ var _map2 = function map(arg) {
15296
15329
  x: m_width / 2,
15297
15330
  y: m_height / 2
15298
15331
  });
15299
- m_this.geoTrigger(geo_event.pan, evt);
15332
+ if (!noTrigger) {
15333
+ m_this.geoTrigger(geo_event.pan, evt);
15334
+ }
15300
15335
  m_this.modified();
15301
15336
  return m_this;
15302
15337
  };
@@ -15358,7 +15393,7 @@ var _map2 = function map(arg) {
15358
15393
  /**
15359
15394
  * Get or set the center of the map in the given geographic coordinates.
15360
15395
  *
15361
- * @param {geo.geoPosition} coordinates If specified, the new center of the
15396
+ * @param {geo.geoPosition} [coordinates] If specified, the new center of the
15362
15397
  * map.
15363
15398
  * @param {string|geo.transform|null} [gcs] `undefined` to use the interface
15364
15399
  * gcs, `null` to use the map gcs, or any other transform. If setting the
@@ -15371,10 +15406,11 @@ var _map2 = function map(arg) {
15371
15406
  * view. When `'limited'`, the `clampBoundsX` and `clampBoundsY` options
15372
15407
  * are selectively enforced so that the map will not end up more out of
15373
15408
  * bounds than its current state.
15409
+ * @param {boolean} [noTrigger] If truthy, do not trigger a pan event.
15374
15410
  * @returns {geo.geoPosition|this}
15375
15411
  * @fires geo.event.pan
15376
15412
  */
15377
- this.center = function (coordinates, gcs, ignoreDiscreteZoom, ignoreClampBounds) {
15413
+ this.center = function (coordinates, gcs, ignoreDiscreteZoom, ignoreClampBounds, noTrigger) {
15378
15414
  var center;
15379
15415
  if (coordinates === undefined) {
15380
15416
  center = Object.assign({}, m_this.worldToGcs(m_center, gcs));
@@ -15386,12 +15422,14 @@ var _map2 = function map(arg) {
15386
15422
  camera_bounds(m_this.boundsFromZoomAndCenter(m_zoom, center, m_rotation, null, ignoreDiscreteZoom, ignoreClampBounds), m_rotation);
15387
15423
  m_this.modified();
15388
15424
  // trigger a pan event
15389
- m_this.geoTrigger(geo_event.pan, {
15390
- screenDelta: {
15391
- x: 0,
15392
- y: 0
15393
- }
15394
- });
15425
+ if (!noTrigger) {
15426
+ m_this.geoTrigger(geo_event.pan, {
15427
+ screenDelta: {
15428
+ x: 0,
15429
+ y: 0
15430
+ }
15431
+ });
15432
+ }
15395
15433
  return m_this;
15396
15434
  };
15397
15435
 
@@ -16150,7 +16188,7 @@ var _map2 = function map(arg) {
16150
16188
 
16151
16189
  // This might have consequences in terms of bounds/zoom clamping.
16152
16190
  // What behavior do we expect from this method in that case?
16153
- m_this.zoom(nav.zoom);
16191
+ m_this.zoom(nav.zoom, undefined, undefined, undefined, 'pan');
16154
16192
  m_this.center(nav.center, null);
16155
16193
  }
16156
16194
  return m_this.boundsFromZoomAndCenter(m_zoom, m_center, m_rotation, gcs, true);
@@ -25125,7 +25163,7 @@ module.exports = _sceneObject;
25125
25163
  * @constant
25126
25164
  * @type {string}
25127
25165
  */
25128
- module.exports = "9174d2af787e4421e022dca6933c5ee848294c1a";
25166
+ module.exports = "43f61353e44a71f669a4f0d631f102a517605fe9";
25129
25167
 
25130
25168
  /***/ }),
25131
25169
 
@@ -37010,7 +37048,7 @@ module.exports = _vectorFeature;
37010
37048
  * @constant
37011
37049
  * @type {string}
37012
37050
  */
37013
- module.exports = "1.13.1";
37051
+ module.exports = "1.14.0";
37014
37052
 
37015
37053
  /***/ }),
37016
37054