@opengeoweb/webmap 9.0.0 → 9.2.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
@@ -18965,6 +18965,15 @@ var sharedImagesList = {};
18965
18965
  * @returns A signature for this image, which is the same for images with different bbox and or width/height
18966
18966
  */
18967
18967
  var makeQueryStringWithoutGeoInfo = function makeQueryStringWithoutGeoInfo(imageSource) {
18968
+ if (imageSource.indexOf('GFI%3ATIME_ELEVATION') !== -1) {
18969
+ return getUriWithParam(imageSource, {
18970
+ BBOX: '',
18971
+ WIDTH: '',
18972
+ HEIGHT: '',
18973
+ time: '',
18974
+ elevation: ''
18975
+ });
18976
+ }
18968
18977
  return getUriWithParam(imageSource, {
18969
18978
  BBOX: '',
18970
18979
  WIDTH: '',
@@ -27667,7 +27676,7 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
27667
27676
  var x = 707;
27668
27677
  var y = 557;
27669
27678
  var bbox = '29109.947643979103,6500000,1190890.052356021,7200000';
27670
- var _srs = 'EPSG:3857';
27679
+ var _srs = 'GFI:TIME_ELEVATION';
27671
27680
  var _request = layer.getmapURL;
27672
27681
  _request += "&SERVICE=WMS&REQUEST=GetFeatureInfo&VERSION=".concat(layer.version);
27673
27682
  _request += "&LAYERS=".concat(URLEncode(layer.name));
@@ -27696,6 +27705,7 @@ var buildWMSGetMapRequest = function buildWMSGetMapRequest(map, layer) {
27696
27705
  _request += '&FORMAT=image/gif';
27697
27706
  _request += '&INFO_FORMAT=image/png';
27698
27707
  _request += '&STYLES=';
27708
+ _request += '&TRANSPARENT=TRUE';
27699
27709
  var startDate = dateToISO8601(new Date(mapBbox.left));
27700
27710
  var stopDate = dateToISO8601(new Date(mapBbox.right));
27701
27711
  _request += "&time=".concat(startDate, "/").concat(stopDate);
@@ -27933,6 +27943,7 @@ var WMJSMap = /*#__PURE__*/function () {
27933
27943
  this.mapIsActivated = false;
27934
27944
  this.isMapHeaderEnabled = false;
27935
27945
  this.showScaleBarInMap = true;
27946
+ this.showCursorCoordinates = true;
27936
27947
  this.mouseHoverAnimationBox = false;
27937
27948
  this.callBack = new WMListener();
27938
27949
  this.initialized = false;
@@ -28032,6 +28043,8 @@ var WMJSMap = /*#__PURE__*/function () {
28032
28043
  this._makeInfoHTML = this._makeInfoHTML.bind(this);
28033
28044
  this.showScaleBar = this.showScaleBar.bind(this);
28034
28045
  this.hideScaleBar = this.hideScaleBar.bind(this);
28046
+ this.showMouseCursorProperties = this.showMouseCursorProperties.bind(this);
28047
+ this.hideMouseCursorProperties = this.hideMouseCursorProperties.bind(this);
28035
28048
  this.display = this.display.bind(this);
28036
28049
  this.draw = this.draw.bind(this);
28037
28050
  this._draw = this._draw.bind(this);
@@ -28104,6 +28117,7 @@ var WMJSMap = /*#__PURE__*/function () {
28104
28117
  this.setDimension = this.setDimension.bind(this);
28105
28118
  this.zoomToLayer = this.zoomToLayer.bind(this);
28106
28119
  this.setBBOX = this.setBBOX.bind(this);
28120
+ this.setDefaultBBOX = this.setDefaultBBOX.bind(this);
28107
28121
  this.zoomOut = this.zoomOut.bind(this);
28108
28122
  this.zoomIn = this.zoomIn.bind(this);
28109
28123
  this.displayLegendInMap = this.displayLegendInMap.bind(this);
@@ -28412,37 +28426,39 @@ var WMJSMap = /*#__PURE__*/function () {
28412
28426
  ctx.stroke();
28413
28427
  }
28414
28428
  }
28415
- // Mouse projected coords
28416
- ctx.font = '10px Helvetica';
28417
- ctx.textBaseline = 'middle';
28418
- ctx.textAlign = 'left';
28419
- if (isDefined(this.mouseGeoCoordXY)) {
28420
- var roundingFactor = 1.0 / Math.pow(10, parseInt(Math.log((this.bbox.right - this.bbox.left) / this.width) / Math.log(10), 10) - 2);
28421
- if (roundingFactor < 1) {
28422
- roundingFactor = 1;
28423
- }
28424
- ctx.fillStyle = '#000000';
28425
- var xText = Math.round(this.mouseGeoCoordXY.x * roundingFactor) / roundingFactor;
28426
- var yText = Math.round(this.mouseGeoCoordXY.y * roundingFactor) / roundingFactor;
28427
- var _units = '';
28428
- if (this.srs === 'EPSG:3857') {
28429
- _units = 'meter';
28430
- }
28431
- ctx.fillText("CoordYX: (".concat(yText, ", ").concat(xText, ") ").concat(_units), 5, this.height - 50);
28432
- }
28433
- // Mouse latlon coords
28434
- if (isDefined(this.mouseUpdateCoordinates)) {
28435
- var llCoord = this.getLatLongFromPixelCoord(this.mouseUpdateCoordinates);
28436
- if (isDefined(llCoord)) {
28437
- var _roundingFactor = 100;
28429
+ if (this.showCursorCoordinates === true) {
28430
+ // Mouse projected coords
28431
+ ctx.font = '10px Helvetica';
28432
+ ctx.textBaseline = 'middle';
28433
+ ctx.textAlign = 'left';
28434
+ if (isDefined(this.mouseGeoCoordXY)) {
28435
+ var roundingFactor = 1.0 / Math.pow(10, parseInt(Math.log((this.bbox.right - this.bbox.left) / this.width) / Math.log(10), 10) - 2);
28436
+ if (roundingFactor < 1) {
28437
+ roundingFactor = 1;
28438
+ }
28438
28439
  ctx.fillStyle = '#000000';
28439
- var _xText = Math.round(llCoord.x * _roundingFactor) / _roundingFactor;
28440
- var _yText = Math.round(llCoord.y * _roundingFactor) / _roundingFactor;
28441
- ctx.fillText("Lat/Lon: (".concat(_yText.toFixed(2), ", ").concat(_xText.toFixed(2), ") degrees"), 5, this.height - 38);
28440
+ var xText = Math.round(this.mouseGeoCoordXY.x * roundingFactor) / roundingFactor;
28441
+ var yText = Math.round(this.mouseGeoCoordXY.y * roundingFactor) / roundingFactor;
28442
+ var _units = '';
28443
+ if (this.srs === 'EPSG:3857') {
28444
+ _units = 'meter';
28445
+ }
28446
+ ctx.fillText("CoordYX: (".concat(yText, ", ").concat(xText, ") ").concat(_units), 5, this.height - 50);
28447
+ }
28448
+ // Mouse latlon coords
28449
+ if (isDefined(this.mouseUpdateCoordinates)) {
28450
+ var llCoord = this.getLatLongFromPixelCoord(this.mouseUpdateCoordinates);
28451
+ if (isDefined(llCoord)) {
28452
+ var _roundingFactor = 100;
28453
+ ctx.fillStyle = '#000000';
28454
+ var _xText = Math.round(llCoord.x * _roundingFactor) / _roundingFactor;
28455
+ var _yText = Math.round(llCoord.y * _roundingFactor) / _roundingFactor;
28456
+ ctx.fillText("Lat/Lon: (".concat(_yText.toFixed(2), ", ").concat(_xText.toFixed(2), ") degrees"), 5, this.height - 38);
28457
+ }
28442
28458
  }
28459
+ ctx.fillStyle = '#000000';
28460
+ ctx.fillText("Map projection: ".concat(this.srs), 5, this.height - 26);
28443
28461
  }
28444
- ctx.fillStyle = '#000000';
28445
- ctx.fillText("Map projection: ".concat(this.srs), 5, this.height - 26);
28446
28462
  /* Show layer metadata */
28447
28463
  if (this.showLayerInfo === true) {
28448
28464
  var metadataX = 100;
@@ -29082,6 +29098,16 @@ var WMJSMap = /*#__PURE__*/function () {
29082
29098
  value: function hideScaleBar() {
29083
29099
  this.showScaleBarInMap = false;
29084
29100
  }
29101
+ }, {
29102
+ key: "showMouseCursorProperties",
29103
+ value: function showMouseCursorProperties() {
29104
+ this.showCursorCoordinates = true;
29105
+ }
29106
+ }, {
29107
+ key: "hideMouseCursorProperties",
29108
+ value: function hideMouseCursorProperties() {
29109
+ this.showCursorCoordinates = false;
29110
+ }
29085
29111
  }, {
29086
29112
  key: "displayScaleBarInMap",
29087
29113
  value: function displayScaleBarInMap(display) {
@@ -29645,10 +29671,19 @@ var WMJSMap = /*#__PURE__*/function () {
29645
29671
  x: this.mouseDownX,
29646
29672
  y: this.mouseDownY
29647
29673
  });
29674
+ var geoCoords = this.getGeoCoordFromPixelCoord({
29675
+ x: this.mouseDownX,
29676
+ y: this.mouseDownY
29677
+ });
29648
29678
  this.callBack.triggerEvent('onsetmappin', {
29649
29679
  map: this,
29650
29680
  lon: mouseDownLatLon.x,
29651
- lat: mouseDownLatLon.y
29681
+ lat: mouseDownLatLon.y,
29682
+ screenOffsetX: this.mouseDownX,
29683
+ screenOffsetY: this.mouseDownY,
29684
+ projectionX: geoCoords.x,
29685
+ projectionY: geoCoords.y,
29686
+ srs: this.srs
29652
29687
  });
29653
29688
  this.mapPin.setMapPin(this.mouseDownX, this.mouseDownY);
29654
29689
  }
@@ -30487,6 +30522,11 @@ var WMJSMap = /*#__PURE__*/function () {
30487
30522
  this.zoomTo(this.defaultBBOX);
30488
30523
  this.draw('zoomTolayer');
30489
30524
  }
30525
+ }, {
30526
+ key: "setDefaultBBOX",
30527
+ value: function setDefaultBBOX(bbox) {
30528
+ this.defaultBBOX.setBBOX(bbox);
30529
+ }
30490
30530
  }, {
30491
30531
  key: "setBBOX",
30492
30532
  value: function setBBOX(left, bottom, right, top) {
@@ -32484,6 +32524,13 @@ var unRegisterWMJSMap = function unRegisterWMJSMap(wmjsMapId) {
32484
32524
  var getWMJSMapById = function getWMJSMapById(wmjsMapId) {
32485
32525
  return registeredWMMapForReactMapId[wmjsMapId];
32486
32526
  };
32527
+ /**
32528
+ * Get all wmjsMap id's from the lookuptable with wmjsMapId
32529
+ * @param {string} wmjsMapId
32530
+ */
32531
+ var getWMJSMapIds = function getWMJSMapIds() {
32532
+ return Object.keys(registeredWMMapForReactMapId);
32533
+ };
32487
32534
  /**
32488
32535
  * Returns the WMJSDimension object for given layerId and dimension name
32489
32536
  * @param layerId The layerId
@@ -32525,6 +32572,7 @@ var utils = /*#__PURE__*/Object.freeze({
32525
32572
  registerWMJSMap: registerWMJSMap,
32526
32573
  unRegisterWMJSMap: unRegisterWMJSMap,
32527
32574
  getWMJSMapById: getWMJSMapById,
32575
+ getWMJSMapIds: getWMJSMapIds,
32528
32576
  getWMJSDimensionForLayerAndDimension: getWMJSDimensionForLayerAndDimension,
32529
32577
  getWMJSTimeDimensionForLayerId: getWMJSTimeDimensionForLayerId
32530
32578
  });
@@ -33622,4 +33670,4 @@ var getCapabilities = /*#__PURE__*/Object.freeze({
33622
33670
  getLayersFlattenedFromService: getLayersFlattenedFromService
33623
33671
  });
33624
33672
 
33625
- export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, clearImageCache, debugLogger, generateLayerId, generateMapId, generateTimesliderId, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSTimeDimensionForLayerId, getWMLayerById, handleMomentISOString, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, utils as webmapUtils };
33673
+ export { DateInterval, DebugType, EPSGCode, I18n, LayerType, ParseISOTimeRangeDuration, URLDecode, URLEncode, WMBBOX, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, WMGetServiceFromStore, WMImage, WMImageEventType, WMJSDimension, WMJSMap, WMJSService, WMJScheckURL, WMLayer, WMTimer, buildWMSGetMapRequest, clearImageCache, debugLogger, generateLayerId, generateMapId, generateTimesliderId, getCapabilities, getLegendGraphicURLForLayer, getMapImageStore, getUriWithParam, getWMJSDimensionForLayerAndDimension, getWMJSMapById, getWMJSMapIds, getWMJSTimeDimensionForLayerId, getWMLayerById, handleMomentISOString, isDefined, legendImageStore, mockGetCapabilities, parseISO8601DateToDate, parseISO8601IntervalToDateInterval, registerWMJSMap, registerWMLayer, tilesettings, toArray, unRegisterAllWMJSLayersAndMaps, unRegisterWMJSLayer, unRegisterWMJSMap, testSettings as webmapTestSettings, utils as webmapUtils };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengeoweb/webmap",
3
- "version": "9.0.0",
3
+ "version": "9.2.0",
4
4
  "description": "GeoWeb webmap library for the opengeoweb project",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -66,6 +66,7 @@ export default class WMJSMap {
66
66
  private mapIsActivated;
67
67
  private isMapHeaderEnabled;
68
68
  private showScaleBarInMap;
69
+ private showCursorCoordinates;
69
70
  private callBack;
70
71
  initialized: boolean;
71
72
  isDestroyed: boolean;
@@ -180,6 +181,8 @@ export default class WMJSMap {
180
181
  _makeInfoHTML(): void;
181
182
  showScaleBar(): void;
182
183
  hideScaleBar(): void;
184
+ showMouseCursorProperties(): void;
185
+ hideMouseCursorProperties(): void;
183
186
  displayScaleBarInMap(display: boolean): void;
184
187
  display(): void;
185
188
  _animFrameRedraw(): void;
@@ -212,7 +215,7 @@ export default class WMJSMap {
212
215
  onContextMenu: () => boolean;
213
216
  _buildLayerDims(): void;
214
217
  getMapMode(): string;
215
- getWMSGetFeatureInfoRequestURL(layer: WMLayer, x: string, y: string, format?: string): string;
218
+ getWMSGetFeatureInfoRequestURL(layer: WMLayer, x: number, y: number, format?: string): string;
216
219
  setMapModeGetInfo(): void;
217
220
  setMapModeZoomBoxIn(): void;
218
221
  setMapModeZoomOut(): void;
@@ -304,6 +307,7 @@ export default class WMJSMap {
304
307
  setTimeDimension(value: string, triggerEvent: boolean): void;
305
308
  setDimension(name: string, value: string, triggerEvent?: boolean, adjustLayerDims?: boolean): void;
306
309
  zoomToLayer(_layer: WMLayer): void;
310
+ setDefaultBBOX(bbox: WMBBOX): void;
307
311
  setBBOX(left: number | WMBBOX, bottom?: number, right?: number, top?: number): boolean;
308
312
  zoomOut(): void;
309
313
  zoomIn(ratio: number): void;
@@ -1,5 +1,5 @@
1
1
  import WMJSMap, { clearImageCache } from './WMJSMap';
2
- import { isDefined, WMJScheckURL, URLDecode, URLEncode, toArray, debugLogger, DebugType } from './WMJSTools';
2
+ import { isDefined, WMJScheckURL, URLDecode, URLEncode, toArray, debugLogger, DebugType, getUriWithParam } from './WMJSTools';
3
3
  import WMTimer from './WMTimer';
4
4
  import WMGetServiceFromStore from './WMGetServiceFromStore';
5
5
  import { WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle } from './WMConstants';
@@ -9,11 +9,12 @@ import WMImage from './WMImage';
9
9
  import { getLegendGraphicURLForLayer, legendImageStore } from './WMLegend';
10
10
  import { getMapImageStore, WMImageEventType } from './WMImageStore';
11
11
  import { WMJSService } from './WMJSService';
12
+ import { buildWMSGetMapRequest } from './WMJSMapHelpers';
12
13
  export { default as WMJSDimension, handleMomentISOString, } from './WMJSDimension';
13
14
  export { default as WMLayer, LayerType } from './WMLayer';
14
15
  export type { LayerOptions, LayerFoundation } from './WMLayer';
15
16
  export { default as WMBBOX } from './WMBBOX';
16
17
  export type { Bbox } from './WMBBOX';
17
- export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMTimer, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService, getMapImageStore, clearImageCache, };
18
+ export { WMJSMap, DateInterval, parseISO8601IntervalToDateInterval, ParseISOTimeRangeDuration, isDefined, WMTimer, WMGetServiceFromStore, WMJScheckURL, URLEncode, URLDecode, WMDateOutSideRange, WMDateTooEarlyString, WMDateTooLateString, WMEmptyLayerName, WMEmptyLayerTitle, parseISO8601DateToDate, I18n, toArray, getLegendGraphicURLForLayer, legendImageStore, WMImage, debugLogger, DebugType, WMImageEventType, WMJSService, getMapImageStore, clearImageCache, buildWMSGetMapRequest, getUriWithParam, };
18
19
  export * from './types';
19
20
  export * from './WMTimeTypes';
@@ -2,6 +2,7 @@ import type WMJSDimension from './WMJSDimension';
2
2
  import type WMLayer from './WMLayer';
3
3
  import { Bbox } from './WMBBOX';
4
4
  import type WMImage from './WMImage';
5
+ import type WMJSMap from './WMJSMap';
5
6
  export interface AnimationStep {
6
7
  name: string;
7
8
  value: string;
@@ -154,3 +155,9 @@ export interface WMSLayerFromGetCapabilities {
154
155
  value: string;
155
156
  }[];
156
157
  }
158
+ export interface WMJSMapMouseClickEvent {
159
+ map: WMJSMap;
160
+ x: number;
161
+ y: number;
162
+ shiftKeyPressed: boolean;
163
+ }
@@ -27,6 +27,11 @@ export declare const unRegisterWMJSMap: (wmjsMapId: string) => void;
27
27
  * @param {string} wmjsMapId
28
28
  */
29
29
  export declare const getWMJSMapById: (wmjsMapId: string) => WMJSMap;
30
+ /**
31
+ * Get all wmjsMap id's from the lookuptable with wmjsMapId
32
+ * @param {string} wmjsMapId
33
+ */
34
+ export declare const getWMJSMapIds: () => string[];
30
35
  /**
31
36
  * Returns the WMJSDimension object for given layerId and dimension name
32
37
  * @param layerId The layerId