gis-common 5.1.21 → 5.1.23

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.
@@ -2032,20 +2032,29 @@ class GeoUtil {
2032
2032
  * @param lat 纬度
2033
2033
  * @returns 返回格式化后的经纬度字符串,格式为:经度度分秒,纬度度分秒
2034
2034
  */
2035
- static formatLnglat(lng, lat) {
2035
+ static formatLnglat(lng, lat, options) {
2036
2036
  let res = "";
2037
- function formatDegreeToDMS(valueInDegrees) {
2038
- const degree = Math.floor(valueInDegrees);
2039
- const minutes = Math.floor((valueInDegrees - degree) * 60);
2040
- const seconds = (valueInDegrees - degree) * 3600 - minutes * 60;
2041
- return `${degree}°${minutes}′${seconds.toFixed(2)}″`;
2037
+ function _formatDeg(value, type) {
2038
+ const a = parseFloat(value);
2039
+ const degree = parseInt(a);
2040
+ let prefix = "";
2041
+ if (options == null ? void 0 : options.showPrefix) {
2042
+ if (type === "lng") {
2043
+ prefix = degree > 0 ? "E" : "W";
2044
+ } else if (type === "lat") {
2045
+ prefix = degree > 0 ? "N" : "S";
2046
+ }
2047
+ }
2048
+ let min = parseInt((a - degree) * 60);
2049
+ let sec = (a - degree) * 3600 - min * 60;
2050
+ return degree + "°" + min + "′" + sec.toFixed(2) + "″" + prefix;
2042
2051
  }
2043
2052
  if (this.isLnglat(lng, lat)) {
2044
- res = formatDegreeToDMS(lng) + "," + formatDegreeToDMS(lat);
2053
+ res = _formatDeg(lng, "lng") + "," + _formatDeg(lat, "lat");
2045
2054
  } else if (!isNaN(lng)) {
2046
- res = formatDegreeToDMS(lng);
2055
+ res = _formatDeg(lng, "lng");
2047
2056
  } else if (!isNaN(lat)) {
2048
- res = formatDegreeToDMS(lat);
2057
+ res = _formatDeg(lat, "lat");
2049
2058
  }
2050
2059
  return res;
2051
2060
  }
@@ -18150,7 +18159,7 @@ class SVGLoader {
18150
18159
  this.cache = /* @__PURE__ */ new Map();
18151
18160
  this.defaultOptions = {
18152
18161
  useCache: true,
18153
- clearContainer: true,
18162
+ clearContainer: false,
18154
18163
  addClasses: [],
18155
18164
  onLoad: null,
18156
18165
  onError: null,