Skip to content

Commit

Permalink
【release】11.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
songyumeng committed Oct 20, 2022
1 parent 5c1ea51 commit 08ae2c0
Show file tree
Hide file tree
Showing 40 changed files with 8,625 additions and 7,270 deletions.
120 changes: 116 additions & 4 deletions dist/classic/iclient-classic-es6.js
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ var __webpack_exports__ = {};
(() => {
"use strict";

// UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, DatasetService, DatasourceService, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter
// UNUSED EXPORTS: AddressMatchService, BuffersAnalystJobsParameter, DatasetService, DatasourceService, ElasticSearch, GeoCodingParameter, GeoDecodingParameter, KernelDensityJobParameter, MapVLayer, MapVRenderer, MappingParameters, OutputSetting, OverlayGeoJobParameter, ProcessingService, SecurityManager, SingleObjectQueryJobsParameter, SummaryAttributesJobsParameter, SummaryMeshJobParameter, SummaryRegionJobParameter, SuperMap, TopologyValidatorJobsParameter, Util

;// CONCATENATED MODULE: ./src/common/commontypes/Pixel.js
/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
Expand Down Expand Up @@ -4903,7 +4903,7 @@ var FetchRequest = {
if (!this.urlIsLong(url)) {
return this._fetch(url, params, options, type);
} else {
return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
return this._postSimulatie(type, url.substring(0, url.indexOf('?')), Util_Util.getParameters(url), options);
}
},
/**
Expand All @@ -4928,7 +4928,7 @@ var FetchRequest = {
return RequestJSONPPromise.DELETE(config);
}
if (this.urlIsLong(url)) {
return this._postSimulatie(type, url.substring(0, url.indexOf('?') - 1), params, options);
return this._postSimulatie(type, url.substring(0, url.indexOf('?')), Util_Util.getParameters(url), options);
}
return this._fetch(url, params, options, type);
},
Expand Down Expand Up @@ -9674,6 +9674,114 @@ function conversionDegree(degrees) {
return `${degree}°${fraction}'${second}`;
}

/**
* @function scalesToResolutions
* @description 通过比例尺数组计算分辨率数组,没有传入比例尺数组时通过地图范围与地图最大级别进行计算。
* @version 11.0.1
* @param {Array} scales - 比例尺数组。
* @param {Object} bounds - 地图范围。
* @param {number} dpi - 屏幕分辨率。
* @param {string} mapUnit - 地图单位。
* @param {number} [level=22] - 地图最大级别。
* @returns {number} 分辨率。
* @usage
* ```
* // 浏览器
* <script type="text/javascript" src="{cdn}"></script>
* <script>
* const result = {namespace}.scalesToResolutions(scales, bounds, dpi, mapUnit);
*
* </script>
*
* // ES6 Import
* import { scalesToResolutions } from '{npm}';
*
* const result = scalesToResolutions(scales, bounds, dpi, mapUnit);
* ```
*/
function scalesToResolutions(scales, bounds, dpi, mapUnit, level = 22) {
var resolutions = [];
if (scales && scales.length > 0) {
for (let i = 0; i < scales.length; i++) {
resolutions.push(scaleToResolution(scales[i], dpi, mapUnit));
}
} else {
const maxReolution = Math.abs(bounds.left - bounds.right) / 256;
for (let i = 0; i < level; i++) {
resolutions.push(maxReolution / Math.pow(2, i));
}
}
return resolutions.sort(function (a, b) {
return b - a;
});
}
/**
* @function getZoomByResolution
* @description 通过分辨率获取地图级别。
* @version 11.0.1
* @param {number} resolution - 分辨率。
* @param {Array} resolutions - 分辨率数组。
* @returns {number} 地图级别。
* @usage
* ```
* // 浏览器
* <script type="text/javascript" src="{cdn}"></script>
* <script>
* const result = {namespace}.getZoomByResolution(resolution, resolutions);
*
* </script>
*
* // ES6 Import
* import { getZoomByResolution } from '{npm}';
*
* const result = getZoomByResolution(resolution, resolutions);
* ```
*/
function getZoomByResolution(resolution, resolutions) {
let zoom = 0;
let minDistance;
for (let i = 0; i < resolutions.length; i++) {
if (i === 0) {
minDistance = Math.abs(resolution - resolutions[i]);
}
if (minDistance > Math.abs(resolution - resolutions[i])) {
minDistance = Math.abs(resolution - resolutions[i]);
zoom = i;
}
}
return zoom;
}

/**
* @function scaleToResolution
* @description 通过比例尺计算分辨率。
* @version 11.0.1
* @param {number} scale - 比例尺。
* @param {number} dpi - 屏幕分辨率。
* @param {string} mapUnit - 地图单位。
* @returns {number} 分辨率。
* @usage
* ```
* // 浏览器
* <script type="text/javascript" src="{cdn}"></script>
* <script>
* const result = {namespace}.scaleToResolution(scale, dpi, mapUnit);
*
* </script>
*
* // ES6 Import
* import { scaleToResolution } from '{npm}';
*
* const result = scaleToResolution(scale, dpi, mapUnit);
* ```
*/
function scaleToResolution(scale, dpi, mapUnit) {
const inchPerMeter = 1 / 0.0254;
const meterPerMapUnitValue = getMeterPerMapUnit(mapUnit);
const resolution = 1 / (scale * dpi * inchPerMeter * meterPerMapUnitValue);
return resolution;
}

;// CONCATENATED MODULE: ./src/classic/overlay/mapv/MapVRenderer.js
/* Copyright© 2000 - 2022 SuperMap Software Co.Ltd. All rights reserved.
* This program are made available under the terms of the Apache License, Version 2.0
Expand Down Expand Up @@ -10575,6 +10683,7 @@ class JSONFormat extends Format {
object = JSON.parse(json, filter);
} catch (e) {
// Fall through if the regexp test fails.
return { data: json}
}
}

Expand Down Expand Up @@ -10793,6 +10902,7 @@ class CommonServiceBase {
options.crossOrigin = options.crossOrigin != undefined ? options.crossOrigin : me.crossOrigin;
options.headers = options.headers || me.headers;
options.isInTheSameDomain = me.isInTheSameDomain;
options.withoutFormatSuffix = options.scope.withoutFormatSuffix || false;
//为url添加安全认证信息片段
options.url = SecurityManager.appendCredential(options.url);

Expand Down Expand Up @@ -10927,6 +11037,7 @@ class CommonServiceBase {
}
FetchRequest.commit(options.method, options.url, options.params, {
headers: options.headers,
withoutFormatSuffix: options.withoutFormatSuffix,
withCredentials: options.withCredentials,
crossOrigin: options.crossOrigin,
timeout: options.async ? 0 : null,
Expand Down Expand Up @@ -13656,6 +13767,7 @@ SuperMap.REST.ProcessingService = ProcessingService;




;// CONCATENATED MODULE: ./src/classic/namespace.js


Expand All @@ -13673,7 +13785,7 @@ SuperMap.OutputSetting = OutputSetting;
SuperMap.MappingParameters = MappingParameters;
SuperMap.GeoCodingParameter = GeoCodingParameter;
SuperMap.GeoDecodingParameter = GeoDecodingParameter;

SuperMap.Util = {...SuperMap.Util, ...Util_Util};


})();
Expand Down
Loading

0 comments on commit 08ae2c0

Please sign in to comment.