From 2800fa4f32f3900509cb4d6eefaf2bfaf54efdd7 Mon Sep 17 00:00:00 2001
From: 罗广辉 <guanghui.luo@foxmail.com>
Date: Mon, 21 Apr 2025 18:29:09 +0800
Subject: [PATCH] fix: 天气显示
---
src/utils/cesium/AmapMercatorTilingScheme/index.js | 66 +++++++++++++++------------------
1 files changed, 30 insertions(+), 36 deletions(-)
diff --git a/src/utils/cesium/AmapMercatorTilingScheme/index.js b/src/utils/cesium/AmapMercatorTilingScheme/index.js
index 6b81249..dee4295 100644
--- a/src/utils/cesium/AmapMercatorTilingScheme/index.js
+++ b/src/utils/cesium/AmapMercatorTilingScheme/index.js
@@ -8,46 +8,40 @@
* Copyright (c) 2024 by GuLiMmo, All Rights Reserved.
*/
import {
- WebMercatorProjection,
- WebMercatorTilingScheme,
- Math,
- Cartographic,
- Cartesian2,
-} from 'cesium';
-import CoordTransform from './CoordTransform';
+ WebMercatorProjection,
+ WebMercatorTilingScheme,
+ Math,
+ Cartographic,
+ Cartesian2,
+} from 'cesium'
+import CoordTransform from './CoordTransform'
class AmapMercatorTilingScheme extends WebMercatorTilingScheme {
- constructor() {
- super();
+ constructor() {
+ super()
- let projection = new WebMercatorProjection();
+ let projection = new WebMercatorProjection()
- this._projection.project = function (cartographic, result) {
- result = CoordTransform.WGS84ToGCJ02(
- Math.toDegrees(cartographic.longitude),
- Math.toDegrees(cartographic.latitude),
- );
- result = projection.project(
- new Cartographic(
- Math.toRadians(result[0]),
- Math.toRadians(result[1]),
- ),
- );
- return new Cartesian2(result.x, result.y);
- };
+ this._projection.project = function (cartographic, result) {
+ result = CoordTransform.WGS84ToGCJ02(
+ Math.toDegrees(cartographic.longitude),
+ Math.toDegrees(cartographic.latitude)
+ )
+ result = projection.project(
+ new Cartographic(Math.toRadians(result[0]), Math.toRadians(result[1]))
+ )
+ return new Cartesian2(result.x, result.y)
+ }
- this._projection.unproject = function (cartesian, result) {
- let cartographic = projection.unproject(cartesian);
- result = CoordTransform.GCJ02ToWGS84(
- Math.toDegrees(cartographic.longitude),
- Math.toDegrees(cartographic.latitude),
- );
- return new Cartographic(
- Math.toRadians(result[0]),
- Math.toRadians(result[1]),
- );
- };
- }
+ this._projection.unproject = function (cartesian, result) {
+ let cartographic = projection.unproject(cartesian)
+ result = CoordTransform.GCJ02ToWGS84(
+ Math.toDegrees(cartographic.longitude),
+ Math.toDegrees(cartographic.latitude)
+ )
+ return new Cartographic(Math.toRadians(result[0]), Math.toRadians(result[1]))
+ }
+ }
}
-export default AmapMercatorTilingScheme;
+export default AmapMercatorTilingScheme
--
Gitblit v1.9.3