@@ -990,7 +990,7 @@ var __webpack_exports__ = {};
990990( ( ) => {
991991"use strict" ;
992992
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
994994
995995; // CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
996996/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
@@ -4903,7 +4903,7 @@ var FetchRequest = {
49034903 if ( ! this . urlIsLong ( url ) ) {
49044904 return this . _fetch ( url , params , options , type ) ;
49054905 } 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 ) ;
49074907 }
49084908 } ,
49094909 /**
@@ -4928,7 +4928,7 @@ var FetchRequest = {
49284928 return RequestJSONPPromise . DELETE ( config ) ;
49294929 }
49304930 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 ) ;
49324932 }
49334933 return this . _fetch ( url , params , options , type ) ;
49344934 } ,
@@ -9674,6 +9674,114 @@ function conversionDegree(degrees) {
96749674 return `${ degree } °${ fraction } '${ second } ` ;
96759675}
96769676
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+
96779785; // CONCATENATED MODULE: ./src/classic/overlay/mapv/MapVRenderer.js
96789786/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
96799787 * This program are made available under the terms of the Apache License, Version 2.0
@@ -10575,6 +10683,7 @@ class JSONFormat extends Format {
1057510683 object = JSON . parse ( json , filter ) ;
1057610684 } catch ( e ) {
1057710685 // Fall through if the regexp test fails.
10686+ return { data : json }
1057810687 }
1057910688 }
1058010689
@@ -10793,6 +10902,7 @@ class CommonServiceBase {
1079310902 options . crossOrigin = options . crossOrigin != undefined ? options . crossOrigin : me . crossOrigin ;
1079410903 options . headers = options . headers || me . headers ;
1079510904 options . isInTheSameDomain = me . isInTheSameDomain ;
10905+ options . withoutFormatSuffix = options . scope . withoutFormatSuffix || false ;
1079610906 //为url添加安全认证信息片段
1079710907 options . url = SecurityManager . appendCredential ( options . url ) ;
1079810908
@@ -10927,6 +11037,7 @@ class CommonServiceBase {
1092711037 }
1092811038 FetchRequest . commit ( options . method , options . url , options . params , {
1092911039 headers : options . headers ,
11040+ withoutFormatSuffix : options . withoutFormatSuffix ,
1093011041 withCredentials : options . withCredentials ,
1093111042 crossOrigin : options . crossOrigin ,
1093211043 timeout : options . async ? 0 : null ,
@@ -13656,6 +13767,7 @@ SuperMap.REST.ProcessingService = ProcessingService;
1365613767
1365713768
1365813769
13770+
1365913771; // CONCATENATED MODULE: ./src/classic/namespace.js
1366013772
1366113773
@@ -13673,7 +13785,7 @@ SuperMap.OutputSetting = OutputSetting;
1367313785SuperMap . MappingParameters = MappingParameters ;
1367413786SuperMap . GeoCodingParameter = GeoCodingParameter ;
1367513787SuperMap . GeoDecodingParameter = GeoDecodingParameter ;
13676-
13788+ SuperMap . Util = { ... SuperMap . Util , ... Util_Util } ;
1367713789
1367813790
1367913791} ) ( ) ;
0 commit comments