From 787a58bac57e734b29f9b8aab1980c1837508e4e Mon Sep 17 00:00:00 2001 From: rainhon <240918304@qq.com> Date: Tue, 7 Nov 2023 15:59:11 +0800 Subject: [PATCH] =?UTF-8?q?fix:=E9=AB=98=E5=BE=B7=E5=9C=B0=E5=9B=BEmarker?= =?UTF-8?q?=E5=88=9B=E5=BB=BA=E6=8A=A5=E9=94=99=EF=BC=8C=E6=97=A0=E6=B3=95?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/views/form/map.blade.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/views/form/map.blade.php b/resources/views/form/map.blade.php index d45889ae4..b9e88a7dc 100755 --- a/resources/views/form/map.blade.php +++ b/resources/views/form/map.blade.php @@ -210,13 +210,14 @@ function myFun() { @endif @if($type === 'amap') function initAmap(){ + var center = lng.val() && lat.val() ? [lng.val(), lat.val()] : null var map = new AMap.Map(container[0], { resizeEnable: true, - center: lng.val() && lat.val() ? [lng.val(), lat.val()] : null, + center: center, zoom: 14 }); var marker = new AMap.Marker({ - position: new AMap.LngLat(lng.val(), lat.val()), + position: center, draggable: true, map:map, icon:'//a.amap.com/jsapi_demos/static/demo-center/icons/poi-marker-red.png',