From c9c43c087cfcc2ad1c47ce8ba94d4f0a5d222801 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Thu, 25 Jan 2024 14:00:27 +0800 Subject: [PATCH] up --- public/dashboard/index.html | 70 ++++++++++++++++++++----------------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/public/dashboard/index.html b/public/dashboard/index.html index 0ddc6d0..64b5a69 100644 --- a/public/dashboard/index.html +++ b/public/dashboard/index.html @@ -661,44 +661,50 @@ } }] }); + panToHospital() window.setInterval(function() { - panToHospital(); + // panToHospital(); }, 3000); } function panToHospital() { - current_hospital++; - if (current_hospital == hospitals.length) { - current_hospital = 0; - } - var center = new TMap.LatLng(hospitals[current_hospital].lat, hospitals[current_hospital].lng); - map.panTo(center); + // current_hospital++; + // if (current_hospital == hospitals.length) { + // current_hospital = 0; + // } + hospitals.map(item=>{ + var center = new TMap.LatLng(item.lat, item.lng); + // marker.setMap(null); + // var marker1 = null; + var marker1 = new TMap.MultiMarker({ + id: "marker-layer", //图层id + map: map, + styles: { //点标注的相关样式 + "marker": new TMap.MarkerStyle({ + "width": 25, + "height": 35, + "anchor": { + x: 16, + y: 32 + }, + "src": "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png" + }) + }, + geometries: [{ //点标注数据数组 + "id": "demo", + "styleId": "marker", + "position": center, + "properties": { + "title": "marker" + } + }] + }); + marker.push(marker1) + }) + + // map.panTo(center); + - marker.setMap(null); - marker = null; - marker = new TMap.MultiMarker({ - id: "marker-layer", //图层id - map: map, - styles: { //点标注的相关样式 - "marker": new TMap.MarkerStyle({ - "width": 25, - "height": 35, - "anchor": { - x: 16, - y: 32 - }, - "src": "https://mapapi.qq.com/web/lbs/javascriptGL/demo/img/markerDefault.png" - }) - }, - geometries: [{ //点标注数据数组 - "id": "demo", - "styleId": "marker", - "position": center, - "properties": { - "title": "marker" - } - }] - }); }