qwc2 2025.7.1 → 2025.7.3

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.
Files changed (61) hide show
  1. package/actions/map.js +1 -1
  2. package/components/IdentifyViewer.js +4 -4
  3. package/components/QtDesignerForm.js +1 -1
  4. package/components/SearchBox.js +1 -1
  5. package/components/map3d/Compare3D.js +2 -2
  6. package/components/map3d/EditDataset3D.js +8 -0
  7. package/components/map3d/ExportObjects3D.js +2 -1
  8. package/components/map3d/ImportObjects3D.js +1 -1
  9. package/components/map3d/LayerTree3D.js +1 -1
  10. package/components/map3d/Map3D.js +12 -10
  11. package/components/map3d/Map3DLight.js +3 -3
  12. package/components/map3d/MapControls3D.js +3 -2
  13. package/components/map3d/SearchField3D.js +5 -5
  14. package/components/map3d/drawtool/EditTool3D.js +1 -1
  15. package/components/map3d/drawtool/NumericInput3D.js +3 -2
  16. package/components/map3d/drawtool/style/NumericInput3D.css +12 -0
  17. package/components/map3d/style/Map3D.css +10 -0
  18. package/components/map3d/utils/FirstPersonControls3D.js +3 -3
  19. package/components/map3d/utils/MiscUtils3D.js +7 -6
  20. package/components/map3d/utils/OrbitControls3D.js +1 -1
  21. package/components/style/SideBar.css +2 -0
  22. package/components/widgets/SearchWidget.js +1 -1
  23. package/icons/above.svg +81 -0
  24. package/icons/below.svg +81 -0
  25. package/icons/middle_h.svg +83 -0
  26. package/icons/middle_v.svg +83 -0
  27. package/package.json +1 -1
  28. package/plugins/API.js +49 -13
  29. package/plugins/LayerTree.js +1 -1
  30. package/plugins/MapLegend.js +1 -1
  31. package/plugins/NewsPopup.js +2 -2
  32. package/plugins/TopBar.js +1 -1
  33. package/plugins/View3D.js +7 -6
  34. package/plugins/style/MapLegend.css +4 -2
  35. package/reducers/map.js +3 -3
  36. package/reducers/windows.js +1 -1
  37. package/static/translations/bg-BG.json +0 -1
  38. package/static/translations/ca-ES.json +265 -266
  39. package/static/translations/cs-CZ.json +0 -1
  40. package/static/translations/de-CH.json +1 -2
  41. package/static/translations/de-DE.json +1 -2
  42. package/static/translations/en-US.json +1 -2
  43. package/static/translations/es-ES.json +264 -265
  44. package/static/translations/fi-FI.json +0 -1
  45. package/static/translations/fr-FR.json +1 -2
  46. package/static/translations/hu-HU.json +0 -1
  47. package/static/translations/it-IT.json +1 -2
  48. package/static/translations/ja-JP.json +26 -27
  49. package/static/translations/nl-NL.json +0 -1
  50. package/static/translations/no-NO.json +0 -1
  51. package/static/translations/pl-PL.json +0 -1
  52. package/static/translations/pt-BR.json +0 -1
  53. package/static/translations/pt-PT.json +0 -1
  54. package/static/translations/ro-RO.json +0 -1
  55. package/static/translations/ru-RU.json +0 -1
  56. package/static/translations/sv-SE.json +0 -1
  57. package/static/translations/tr-TR.json +0 -1
  58. package/static/translations/tsconfig.json +0 -1
  59. package/utils/ConfigUtils.js +2 -2
  60. package/utils/MapUtils.js +3 -3
  61. package/utils/img/person.png +0 -0
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "Tourner",
148
148
  "rotation": "Rotation",
149
149
  "scale": "Redimensionner",
150
- "sizeunavailable": "Dimensions pas disponibles pour l'objet pivoté",
151
150
  "sphere": "Sphère",
152
151
  "subtract": "Soustraire",
153
152
  "thescale": "Echelle",
@@ -339,7 +338,7 @@
339
338
  "resetrotation": "Réinitialiser la rotation"
340
339
  },
341
340
  "map3d": {
342
- "lockview": "Déplacer avec vue 2D",
341
+ "lockview": "Auto-sync des vues 2D/3D",
343
342
  "syncview": "Synchroniser avec vue 2D",
344
343
  "terrain": "Terrain",
345
344
  "title": "Vue 3D"
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "Ruota",
148
148
  "rotation": "Rotazione",
149
149
  "scale": "Scala",
150
- "sizeunavailable": "Dimensioni non disponibili per oggetto ruotato",
151
150
  "sphere": "Sfera",
152
151
  "subtract": "Differenza",
153
152
  "thescale": "Scala",
@@ -339,7 +338,7 @@
339
338
  "resetrotation": "Resetta orientamento"
340
339
  },
341
340
  "map3d": {
342
- "lockview": "Muovi con visuale 2D",
341
+ "lockview": "Auto-sincronizzazione delle viste 2D/3D",
343
342
  "syncview": "Sincronizza con visuale 2D",
344
343
  "terrain": "Terreno",
345
344
  "title": "Visuale 3D"
@@ -53,7 +53,7 @@
53
53
  "Redlining": "スケッチ",
54
54
  "Routing": "ルート探索",
55
55
  "Tools": "地図ツール",
56
- "TourGuide": "",
56
+ "TourGuide": "ツアー・ガイド",
57
57
  "TimeManager": "タイム・マネージャ",
58
58
  "View3D": "3D 表示"
59
59
  },
@@ -130,15 +130,15 @@
130
130
  "title": "Cyclomedia ビューワ"
131
131
  },
132
132
  "draw3d": {
133
- "clone": "",
133
+ "clone": "クローン",
134
134
  "cone": "円錐",
135
- "ctrlhint": "",
135
+ "ctrlhint": "Ctrl を使うと複数選択できます",
136
136
  "cuboid": "直方体",
137
137
  "cylinder": "円柱",
138
138
  "delete": "削除",
139
139
  "drawings": "作図",
140
140
  "intersect": "交差",
141
- "label": "",
141
+ "label": "ラベル",
142
142
  "newgroupprompt": "新しい作図グループ",
143
143
  "numericinput": "数値入力",
144
144
  "pick": "選択",
@@ -147,11 +147,10 @@
147
147
  "rotate": "回転",
148
148
  "rotation": "回転角",
149
149
  "scale": "スケール",
150
- "sizeunavailable": "",
151
150
  "sphere": "球体",
152
151
  "subtract": "差分",
153
152
  "thescale": "スケール",
154
- "thesize": "",
153
+ "thesize": "サイズ",
155
154
  "translate": "移動",
156
155
  "undoBool": "ブーリアン操作を取り消し",
157
156
  "union": "合成(和)",
@@ -171,7 +170,7 @@
171
170
  "draw": "作図",
172
171
  "feature": "地物",
173
172
  "geomnonzeroz": "ジオメトリが 0 でない Z 値を含んでいるため、リード・オンリーです。",
174
- "geomreadonly": "",
173
+ "geomreadonly": "ジオメトリがリード・オンリーです。",
175
174
  "invalidform": "無効なフォーム",
176
175
  "maximize": "最大化",
177
176
  "minimize": "最小化",
@@ -246,7 +245,7 @@
246
245
  "noresults": "選択された点には情報がありません",
247
246
  "querying": "検索中...",
248
247
  "reportfail": "レポートを生成することが出来ませんでした",
249
- "selectreport": "",
248
+ "selectreport": "レポートを選択...",
250
249
  "title": "地物情報"
251
250
  },
252
251
  "imageeditor": {
@@ -254,8 +253,8 @@
254
253
  "title": "イメージ・エディタ"
255
254
  },
256
255
  "import3d": {
257
- "importing": "",
258
- "noprocessesserver": ""
256
+ "importing": "{0} をインポートしています...",
257
+ "noprocessesserver": "インポート・サービスが構成されていません"
259
258
  },
260
259
  "importlayer": {
261
260
  "addfailed": "レイヤを追加できませんでした。",
@@ -297,7 +296,7 @@
297
296
  "layertree": {
298
297
  "compare": "トップ・レイヤを比較",
299
298
  "deletealllayers": "全てのレイヤを削除",
300
- "hidealllayers": "",
299
+ "hidealllayers": "全てのレイヤを非表示",
301
300
  "importlayer": "レイヤをインポート",
302
301
  "maptip": "レイヤのマップ・チップを表示",
303
302
  "printlegend": "凡例を印刷",
@@ -308,12 +307,12 @@
308
307
  "zoomtolayer": "レイヤにズーム"
309
308
  },
310
309
  "layertree3d": {
311
- "customheight": "",
310
+ "customheight": "",
312
311
  "import": "インポート",
313
312
  "importobjects": "オブジェクトをインポート",
314
313
  "layers": "レイヤ",
315
314
  "objects": "オブジェクト",
316
- "supportedformats": "サポートされている形式",
315
+ "supportedformats": "サポートされている形式: GLTF",
317
316
  "zoomtoobject": "オブジェクトにズーム"
318
317
  },
319
318
  "linkfeatureform": {
@@ -339,15 +338,15 @@
339
338
  "resetrotation": "回転をリセット"
340
339
  },
341
340
  "map3d": {
342
- "lockview": "",
343
- "syncview": "ビューを同期",
341
+ "lockview": "2D ビューとともに移動",
342
+ "syncview": "2D ビューと同期",
344
343
  "terrain": "地形",
345
344
  "title": "3D ビュー"
346
345
  },
347
346
  "mapexport": {
348
347
  "configuration": "構成",
349
348
  "format": "形式",
350
- "projection": "",
349
+ "projection": "投影",
351
350
  "resolution": "解像度",
352
351
  "scale": "縮尺",
353
352
  "size": "サイズ",
@@ -385,7 +384,7 @@
385
384
  "dayspersec": "日数 / 秒",
386
385
  "helpersVisible": "補助オブジェクト表示",
387
386
  "minspersec": "分 / 秒",
388
- "moonLightIntensity": "",
387
+ "moonLightIntensity": "月光強度",
389
388
  "normalBias": "ノーマル・バイアス",
390
389
  "shadowBias": "シャドウ・バイアス",
391
390
  "shadowMapSize": "シャドウ・マップ・サイズ",
@@ -395,16 +394,16 @@
395
394
  "shadowintensity": "影の強度",
396
395
  "shadows": "シャドウを有効化",
397
396
  "showadvanced": "詳細設定を表示",
398
- "sunLightIntensity": "",
397
+ "sunLightIntensity": "陽光強度",
399
398
  "time": "時刻",
400
399
  "zFactor": "Zファクター"
401
400
  },
402
401
  "measureComponent": {
403
402
  "absolute": "m (海抜)",
404
- "areaLabel": "領域",
403
+ "areaLabel": "面積",
405
404
  "bearingLabel": "方角",
406
405
  "ground": "m (地上高)",
407
- "heightDiffLabel": "",
406
+ "heightDiffLabel": "高度差",
408
407
  "imperial": "ヤード・ポンド法",
409
408
  "lengthLabel": "長さ",
410
409
  "metric": "メートル法",
@@ -555,7 +554,7 @@
555
554
  "all": "全て",
556
555
  "circleradius": "円の半径",
557
556
  "clearfilter": "クリア",
558
- "coordinates": "",
557
+ "coordinates": "座標",
559
558
  "existinglayer": "レイヤは既に地図の中に存在します",
560
559
  "filter": "検索を詳細化",
561
560
  "layers": "レイヤ",
@@ -690,9 +689,9 @@
690
689
  "zoomout": "ズーム・アウト"
691
690
  },
692
691
  "tourguide": {
693
- "done": "",
694
- "next": "",
695
- "previous": ""
692
+ "done": "完了",
693
+ "next": "次へ",
694
+ "previous": "前へ"
696
695
  },
697
696
  "valuetool": {
698
697
  "all": "",
@@ -733,9 +732,9 @@
733
732
  "unminimize": "元のサイズに戻す"
734
733
  },
735
734
  "colorschemes": {
736
- "default": "",
737
- "dark": "",
738
- "highcontrast": ""
735
+ "default": "デフォルト",
736
+ "dark": "ダーク",
737
+ "highcontrast": "ハイ・コントラスト"
739
738
  }
740
739
  }
741
740
  }
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "",
148
148
  "rotation": "",
149
149
  "scale": "",
150
- "sizeunavailable": "",
151
150
  "sphere": "",
152
151
  "subtract": "",
153
152
  "thescale": "",
@@ -147,7 +147,6 @@
147
147
  "rotate": "Döndür",
148
148
  "rotation": "Dönüklük",
149
149
  "scale": "Ölçek",
150
- "sizeunavailable": "",
151
150
  "sphere": "Küre",
152
151
  "subtract": "",
153
152
  "thescale": "Ölçek",
@@ -154,7 +154,6 @@
154
154
  "draw3d.rotate",
155
155
  "draw3d.rotation",
156
156
  "draw3d.scale",
157
- "draw3d.sizeunavailable",
158
157
  "draw3d.sphere",
159
158
  "draw3d.subtract",
160
159
  "draw3d.thescale",
@@ -5,5 +5,5 @@ function ownKeys(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var
5
5
  *
6
6
  * This source code is licensed under the BSD-style license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
- */import axios from"axios";import isMobile from"ismobilejs";import url from"url";var config={assetsPath:"assets",translationsPath:"translations",defaultFeatureStyle:{strokeColor:[0,0,255,1],strokeWidth:2,strokeDash:[4],fillColor:[0,0,255,0.33],circleRadius:10,textFill:"black",textStroke:"white"}};export default{getDefaults:function getDefaults(){return config},loadConfiguration:function loadConfiguration(){var configParams=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var configFile="config.json";var urlQuery=url.parse(window.location.href,true).query;if(urlQuery.localConfig){configFile=urlQuery.localConfig+".json"}return axios.get(configFile,{params:configParams}).then(function(response){if(_typeof(response.data)==="object"){config=_objectSpread(_objectSpread({},config),response.data)}else{/* eslint-disable-next-line */console.warn("Broken configuration file "+configFile+"!")}// Set isMobile
9
- config.isMobile=isMobile(window.navigator).any;return config})},isMobile:function isMobile(){return config.isMobile},getConfigProp:function getConfigProp(prop,theme){var _theme$config$section,_theme$config,_theme$config2,_ref,_ref2,_config$section;var defval=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;var section=config.isMobile?"mobile":"desktop";var themeProp=(_theme$config$section=theme===null||theme===void 0||(_theme$config=theme.config)===null||_theme$config===void 0||(_theme$config=_theme$config[section])===null||_theme$config===void 0?void 0:_theme$config[prop])!==null&&_theme$config$section!==void 0?_theme$config$section:theme===null||theme===void 0||(_theme$config2=theme.config)===null||_theme$config2===void 0?void 0:_theme$config2[prop];return(_ref=(_ref2=themeProp!==null&&themeProp!==void 0?themeProp:(_config$section=config[section])===null||_config$section===void 0?void 0:_config$section[prop])!==null&&_ref2!==void 0?_ref2:config[prop])!==null&&_ref!==void 0?_ref:defval},getAssetsPath:function getAssetsPath(){return config.assetsPath.replace(/\/$/g,"")},getTranslationsPath:function getTranslationsPath(){return config.translationsPath.replace(/\/$/g,"")},havePlugin:function havePlugin(name){return config.plugins[config.isMobile?"mobile":"desktop"].find(function(entry){return entry.name===name})},getPluginConfig:function getPluginConfig(name){return config.plugins[config.isMobile?"mobile":"desktop"].find(function(entry){return entry.name===name})||{}}};
8
+ */import axios from"axios";import isMobile from"ismobilejs";import url from"url";var config={assetsPath:"assets",translationsPath:"translations",defaultFeatureStyle:{strokeColor:[0,0,255,1],strokeWidth:2,strokeDash:[4],fillColor:[0,0,255,0.33],circleRadius:10,textFill:"black",textStroke:"white"}};var sessionConfig={};export default{getDefaults:function getDefaults(){return config},loadConfiguration:function loadConfiguration(){var configParams=arguments.length>0&&arguments[0]!==undefined?arguments[0]:{};var configFile="config.json";var urlQuery=url.parse(window.location.href,true).query;if(urlQuery.localConfig){configFile=urlQuery.localConfig+".json"}return axios.get(configFile,{params:configParams}).then(function(response){if(_typeof(response.data)==="object"){config=_objectSpread(_objectSpread({},config),response.data)}else{/* eslint-disable-next-line */console.warn("Broken configuration file "+configFile+"!")}// Set isMobile
9
+ config.isMobile=isMobile(window.navigator).any;return config})},isMobile:function isMobile(){return config.isMobile},getConfigProp:function getConfigProp(prop,theme){var _theme$config$section,_theme$config,_theme$config2,_ref,_ref2,_config$section;var defval=arguments.length>2&&arguments[2]!==undefined?arguments[2]:undefined;var section=config.isMobile?"mobile":"desktop";var themeProp=(_theme$config$section=theme===null||theme===void 0||(_theme$config=theme.config)===null||_theme$config===void 0||(_theme$config=_theme$config[section])===null||_theme$config===void 0?void 0:_theme$config[prop])!==null&&_theme$config$section!==void 0?_theme$config$section:theme===null||theme===void 0||(_theme$config2=theme.config)===null||_theme$config2===void 0?void 0:_theme$config2[prop];return(_ref=(_ref2=themeProp!==null&&themeProp!==void 0?themeProp:(_config$section=config[section])===null||_config$section===void 0?void 0:_config$section[prop])!==null&&_ref2!==void 0?_ref2:config[prop])!==null&&_ref!==void 0?_ref:defval},getAssetsPath:function getAssetsPath(){return config.assetsPath.replace(/\/$/g,"")},getTranslationsPath:function getTranslationsPath(){return config.translationsPath.replace(/\/$/g,"")},havePlugin:function havePlugin(name){return config.plugins[config.isMobile?"mobile":"desktop"].find(function(entry){return entry.name===name})},getPluginConfig:function getPluginConfig(name){return config.plugins[config.isMobile?"mobile":"desktop"].find(function(entry){return entry.name===name})||{}},setSessionConfig:function setSessionConfig(name,value){sessionConfig[name]=value},getSessionConfig:function getSessionConfig(name){return sessionConfig[name]}};
package/utils/MapUtils.js CHANGED
@@ -5,7 +5,7 @@
5
5
  *
6
6
  * This source code is licensed under the BSD-style license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
- */import ConfigUtils from"./ConfigUtils";import CoordinatesUtils from"./CoordinatesUtils";var DEFAULT_SCREEN_DPI=96;var METERS_PER_UNIT={"m":1,"degrees":111194.87428468118,"ft":0.3048,"us-ft":1200/3937};var hooks={};var MapUtils={GET_PIXEL_FROM_COORDINATES_HOOK:"GET_PIXEL_FROM_COORDINATES_HOOK",GET_COORDINATES_FROM_PIXEL_HOOK:"GET_COORDINATES_FROM_PIXEL_HOOK",GET_SNAPPED_COORDINATES_FROM_PIXEL_HOOK:"GET_SNAPPED_COORDINATES_FROM_PIXEL_HOOK",GET_NATIVE_LAYER:"GET_NATIVE_LAYER",ADD_POINTER_MOVE_LISTENER:"ADD_POINTER_MOVE_LISTENER",REMOVE_POINTER_MOVE_LISTENER:"REMOVE_POINTER_MOVE_LISTENER",GET_MAP:"GET_MAP",registerHook:function registerHook(name,hook){hooks[name]=hook},getHook:function getHook(name){return hooks[name]},/**
8
+ */import isEmpty from"lodash.isempty";import ConfigUtils from"./ConfigUtils";import CoordinatesUtils from"./CoordinatesUtils";import{UrlParams}from"./PermaLinkUtils";var DEFAULT_SCREEN_DPI=96;var METERS_PER_UNIT={"m":1,"degrees":111194.87428468118,"ft":0.3048,"us-ft":1200/3937};var hooks={};var MapUtils={GET_PIXEL_FROM_COORDINATES_HOOK:"GET_PIXEL_FROM_COORDINATES_HOOK",GET_COORDINATES_FROM_PIXEL_HOOK:"GET_COORDINATES_FROM_PIXEL_HOOK",GET_SNAPPED_COORDINATES_FROM_PIXEL_HOOK:"GET_SNAPPED_COORDINATES_FROM_PIXEL_HOOK",GET_NATIVE_LAYER:"GET_NATIVE_LAYER",ADD_POINTER_MOVE_LISTENER:"ADD_POINTER_MOVE_LISTENER",REMOVE_POINTER_MOVE_LISTENER:"REMOVE_POINTER_MOVE_LISTENER",GET_MAP:"GET_MAP",registerHook:function registerHook(name,hook){hooks[name]=hook},getHook:function getHook(name){return hooks[name]},/**
9
9
  * @param dpi {number} dot per inch resolution
10
10
  * @return {number} dot per meter resolution
11
11
  */dpi2dpm:function dpi2dpm(dpi){return(dpi||DEFAULT_SCREEN_DPI)*(100/2.54)},/**
@@ -33,7 +33,7 @@ var RADIUS=6378137;var TILE_WIDTH=256;var ZOOM_FACTOR=2;var retval=[];for(var l=
33
33
  * @param maxZoom {number} max zoom level.
34
34
  * @param dpi {number} screen resolution in dot per inch.
35
35
  * @return {Number} the zoom level fitting th extent
36
- */getZoomForExtent:function getZoomForExtent(extent,resolutions,mapSize,minZoom,maxZoom){var wExtent=extent[2]-extent[0];var hExtent=extent[3]-extent[1];var xResolution=Math.abs(wExtent/mapSize.width);var yResolution=Math.abs(hExtent/mapSize.height);var extentResolution=Math.max(xResolution,yResolution);if(ConfigUtils.getConfigProp("allowFractionalZoom")===true){return Math.max(minZoom,Math.min(this.computeZoom(resolutions,extentResolution),maxZoom))}else{var calc=resolutions.reduce(function(previous,resolution,index){var diff=Math.abs(resolution-extentResolution);return diff>previous.diff?previous:{diff:diff,zoom:index}},{diff:Number.POSITIVE_INFINITY,zoom:0});return Math.max(minZoom,Math.min(calc.zoom,maxZoom))}},/**
36
+ */getZoomForExtent:function getZoomForExtent(extent,resolutions,mapSize,minZoom,maxZoom){var wExtent=extent[2]-extent[0];var hExtent=extent[3]-extent[1];var xResolution=Math.abs(wExtent/mapSize.width);var yResolution=Math.abs(hExtent/mapSize.height);var extentResolution=Math.max(xResolution,yResolution);var zoom=this.computeZoom(resolutions,extentResolution);if(ConfigUtils.getConfigProp("allowFractionalZoom")===true){return Math.max(minZoom,Math.min(zoom,maxZoom))}else{return Math.max(minZoom,Math.min(Math.round(zoom),maxZoom))}},/**
37
37
  * Calculates the extent for the provided center and zoom level
38
38
  * @param center {Array} [x, y]
39
39
  * @param zoom {number} The zoom level
@@ -63,4 +63,4 @@ var phi=center[1]/180*Math.PI;var latPerM=111132.92-559.82*Math.cos(2*phi)+1.175
63
63
  * Convert degrees to radians
64
64
  * @param degrees {number}
65
65
  * @return {number} in radians
66
- */degreesToRadians:function degreesToRadians(degrees){var pi=Math.PI;return degrees*(pi/180)}};export default MapUtils;
66
+ */degreesToRadians:function degreesToRadians(degrees){var pi=Math.PI;return degrees*(pi/180)},updateMapUrlParams:function updateMapUrlParams(state){var newParams={};var positionFormat=ConfigUtils.getConfigProp("urlPositionFormat");var positionCrs=ConfigUtils.getConfigProp("urlPositionCrs")||state.projection;var prec=CoordinatesUtils.getPrecision(positionCrs);if(positionFormat==="centerAndZoom"){var center=CoordinatesUtils.reproject(state.center,state.projection,positionCrs);var scale=Math.round(MapUtils.computeForZoom(state.scales,state.zoom));Object.assign(newParams,{c:center.map(function(x){return x.toFixed(prec)}).join(","),s:scale})}else{var bounds=CoordinatesUtils.reprojectBbox(state.bbox.bounds,state.projection,positionCrs);Object.assign(newParams,{e:bounds.map(function(x){return x.toFixed(prec)}).join(",")})}if(positionCrs!==state.projection){Object.assign(newParams,{crs:positionCrs})}if(!isEmpty(newParams)){UrlParams.updateParams(newParams)}}};export default MapUtils;
Binary file