From df924bf10a227589397cfd81f714c8bbd62dca44 Mon Sep 17 00:00:00 2001
From: LiuJiaNan <15703339975@163.com>
Date: Mon, 1 Dec 2025 11:12:15 +0800
Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9EdynamicLoadJs=E5=92=8Cdynamic?=
=?UTF-8?q?LoadCss=EF=BC=8C=E4=BC=98=E5=8C=96Map?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
components/Map/MapSelector.js | 3 +++
components/Map/index.js | 13 ++++++++-----
utils/index.d.ts | 10 ++++++++++
utils/index.js | 29 +++++++++++++++++++++++++++++
4 files changed, 50 insertions(+), 5 deletions(-)
diff --git a/components/Map/MapSelector.js b/components/Map/MapSelector.js
index d228c02..aeace24 100644
--- a/components/Map/MapSelector.js
+++ b/components/Map/MapSelector.js
@@ -1,5 +1,6 @@
import { Button, Col, Form, Input, Modal, Row, Select, Spin } from "antd";
import { useEffect, useRef, useState } from "react";
+import { dynamicLoadJs } from "../../utils";
/**
* 定位组件弹窗
@@ -33,6 +34,8 @@ const MapSelector = (props) => {
// 初始化地图
const initMap = async () => {
+ await dynamicLoadJs("https://api.map.baidu.com/api?v=1.0&type=webgl&ak=OElqFYoKiAH8KFtph8ftLKF5NlNrbCUr");
+
if (!window.BMapGL) {
console.error("BMapGL is not loaded");
return;
diff --git a/components/Map/index.js b/components/Map/index.js
index 04c930f..27c4990 100644
--- a/components/Map/index.js
+++ b/components/Map/index.js
@@ -45,11 +45,14 @@ const Map = (props) => {
-