@@ -990,7 +990,7 @@ var __webpack_exports__ = {};
990
990
( ( ) => {
991
991
"use strict" ;
992
992
993
- // UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, DatasetService, DatasourceService, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter
993
+ // UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, DatasetService, DatasourceService, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter, Util
994
994
995
995
; // CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
996
996
/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
@@ -4903,7 +4903,7 @@ var FetchRequest = {
4903
4903
if ( ! this . urlIsLong ( url ) ) {
4904
4904
return this . _fetch ( url , params , options , type ) ;
4905
4905
} else {
4906
- return this . _postSimulatie ( type , url . substring ( 0 , url . indexOf ( '?' ) - 1 ) , params , options ) ;
4906
+ return this . _postSimulatie ( type , url . substring ( 0 , url . indexOf ( '?' ) ) , Util_Util . getParameters ( url ) , options ) ;
4907
4907
}
4908
4908
} ,
4909
4909
/**
@@ -4928,7 +4928,7 @@ var FetchRequest = {
4928
4928
return RequestJSONPPromise . DELETE ( config ) ;
4929
4929
}
4930
4930
if ( this . urlIsLong ( url ) ) {
4931
- return this . _postSimulatie ( type , url . substring ( 0 , url . indexOf ( '?' ) - 1 ) , params , options ) ;
4931
+ return this . _postSimulatie ( type , url . substring ( 0 , url . indexOf ( '?' ) ) , Util_Util . getParameters ( url ) , options ) ;
4932
4932
}
4933
4933
return this . _fetch ( url , params , options , type ) ;
4934
4934
} ,
@@ -9674,6 +9674,114 @@ function conversionDegree(degrees) {
9674
9674
return `${ degree } °${ fraction } '${ second } ` ;
9675
9675
}
9676
9676
9677
+ /**
9678
+ * @function scalesToResolutions
9679
+ * @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
9680
+ * @version 11.0.1
9681
+ * @param {Array } scales - 比例尺数组。
9682
+ * @param {Object } bounds - 地图范围。
9683
+ * @param {number } dpi - 屏幕分辨率。
9684
+ * @param {string } mapUnit - 地图单位。
9685
+ * @param {number } [level=22] - 地图最大级别。
9686
+ * @returns {number } 分辨率。
9687
+ * @usage
9688
+ * ```
9689
+ * // 浏览器
9690
+ * <script type="text/javascript" src="{cdn}"></script>
9691
+ * <script>
9692
+ * const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
9693
+ *
9694
+ * </script>
9695
+ *
9696
+ * // ES6 Import
9697
+ * import { scalesToResolutions } from '{npm}';
9698
+ *
9699
+ * const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
9700
+ * ```
9701
+ */
9702
+ function scalesToResolutions ( scales , bounds , dpi , mapUnit , level = 22 ) {
9703
+ var resolutions = [ ] ;
9704
+ if ( scales && scales . length > 0 ) {
9705
+ for ( let i = 0 ; i < scales . length ; i ++ ) {
9706
+ resolutions . push ( scaleToResolution ( scales [ i ] , dpi , mapUnit ) ) ;
9707
+ }
9708
+ } else {
9709
+ const maxReolution = Math . abs ( bounds . left - bounds . right ) / 256 ;
9710
+ for ( let i = 0 ; i < level ; i ++ ) {
9711
+ resolutions . push ( maxReolution / Math . pow ( 2 , i ) ) ;
9712
+ }
9713
+ }
9714
+ return resolutions . sort ( function ( a , b ) {
9715
+ return b - a ;
9716
+ } ) ;
9717
+ }
9718
+ /**
9719
+ * @function getZoomByResolution
9720
+ * @description 通过分辨率获取地图级别。
9721
+ * @version 11.0.1
9722
+ * @param {number } resolution - 分辨率。
9723
+ * @param {Array } resolutions - 分辨率数组。
9724
+ * @returns {number } 地图级别。
9725
+ * @usage
9726
+ * ```
9727
+ * // 浏览器
9728
+ * <script type="text/javascript" src="{cdn}"></script>
9729
+ * <script>
9730
+ * const result = {namespace}.getZoomByResolution(resolution, resolutions);
9731
+ *
9732
+ * </script>
9733
+ *
9734
+ * // ES6 Import
9735
+ * import { getZoomByResolution } from '{npm}';
9736
+ *
9737
+ * const result = getZoomByResolution(resolution, resolutions);
9738
+ * ```
9739
+ */
9740
+ function getZoomByResolution ( resolution , resolutions ) {
9741
+ let zoom = 0 ;
9742
+ let minDistance ;
9743
+ for ( let i = 0 ; i < resolutions . length ; i ++ ) {
9744
+ if ( i === 0 ) {
9745
+ minDistance = Math . abs ( resolution - resolutions [ i ] ) ;
9746
+ }
9747
+ if ( minDistance > Math . abs ( resolution - resolutions [ i ] ) ) {
9748
+ minDistance = Math . abs ( resolution - resolutions [ i ] ) ;
9749
+ zoom = i ;
9750
+ }
9751
+ }
9752
+ return zoom ;
9753
+ }
9754
+
9755
+ /**
9756
+ * @function scaleToResolution
9757
+ * @description 通过比例尺计算分辨率。
9758
+ * @version 11.0.1
9759
+ * @param {number } scale - 比例尺。
9760
+ * @param {number } dpi - 屏幕分辨率。
9761
+ * @param {string } mapUnit - 地图单位。
9762
+ * @returns {number } 分辨率。
9763
+ * @usage
9764
+ * ```
9765
+ * // 浏览器
9766
+ * <script type="text/javascript" src="{cdn}"></script>
9767
+ * <script>
9768
+ * const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
9769
+ *
9770
+ * </script>
9771
+ *
9772
+ * // ES6 Import
9773
+ * import { scaleToResolution } from '{npm}';
9774
+ *
9775
+ * const result = scaleToResolution(scale, dpi, mapUnit);
9776
+ * ```
9777
+ */
9778
+ function scaleToResolution ( scale , dpi , mapUnit ) {
9779
+ const inchPerMeter = 1 / 0.0254 ;
9780
+ const meterPerMapUnitValue = getMeterPerMapUnit ( mapUnit ) ;
9781
+ const resolution = 1 / ( scale * dpi * inchPerMeter * meterPerMapUnitValue ) ;
9782
+ return resolution ;
9783
+ }
9784
+
9677
9785
; // CONCATENATED MODULE: ./src/classic/overlay/mapv/MapVRenderer.js
9678
9786
/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
9679
9787
* This program are made available under the terms of the Apache License, Version 2.0
@@ -10575,6 +10683,7 @@ class JSONFormat extends Format {
10575
10683
object = JSON . parse ( json , filter ) ;
10576
10684
} catch ( e ) {
10577
10685
// Fall through if the regexp test fails.
10686
+ return { data : json }
10578
10687
}
10579
10688
}
10580
10689
@@ -10793,6 +10902,7 @@ class CommonServiceBase {
10793
10902
options . crossOrigin = options . crossOrigin != undefined ? options . crossOrigin : me . crossOrigin ;
10794
10903
options . headers = options . headers || me . headers ;
10795
10904
options . isInTheSameDomain = me . isInTheSameDomain ;
10905
+ options . withoutFormatSuffix = options . scope . withoutFormatSuffix || false ;
10796
10906
//为url添加安全认证信息片段
10797
10907
options . url = SecurityManager . appendCredential ( options . url ) ;
10798
10908
@@ -10927,6 +11037,7 @@ class CommonServiceBase {
10927
11037
}
10928
11038
FetchRequest . commit ( options . method , options . url , options . params , {
10929
11039
headers : options . headers ,
11040
+ withoutFormatSuffix : options . withoutFormatSuffix ,
10930
11041
withCredentials : options . withCredentials ,
10931
11042
crossOrigin : options . crossOrigin ,
10932
11043
timeout : options . async ? 0 : null ,
@@ -13656,6 +13767,7 @@ SuperMap.REST.ProcessingService = ProcessingService;
13656
13767
13657
13768
13658
13769
13770
+
13659
13771
; // CONCATENATED MODULE: ./src/classic/namespace.js
13660
13772
13661
13773
@@ -13673,7 +13785,7 @@ SuperMap.OutputSetting = OutputSetting;
13673
13785
SuperMap . MappingParameters = MappingParameters ;
13674
13786
SuperMap . GeoCodingParameter = GeoCodingParameter ;
13675
13787
SuperMap . GeoDecodingParameter = GeoDecodingParameter ;
13676
-
13788
+ SuperMap . Util = { ... SuperMap . Util , ... Util_Util } ;
13677
13789
13678
13790
13679
13791
} ) ( ) ;
0 commit comments