管灌系统巡查员智能手机App
app/src/main/assets/js/map.js
@@ -272,7 +272,7 @@
    //保存定位坐标生成轨迹
    var path=[];
    var lineLayer = new T.Polyline([], { color: '#ff4500', weight: 3, opacity: 0.8 });
    let locationMarker;
    function updateLocation(log,lat){
        var lastLat=lat;
        // const intervalId = setInterval(() => {
@@ -281,6 +281,16 @@
            path.push(newPoint);
            lineLayer.setLngLats(path);
            map.addOverLay(lineLayer);
        let icon = new T.Icon({
            iconUrl: locationIMGPath,
            iconSize: new T.Point(27, 27),
            iconAnchor: new T.Point(13, 20)
        });
        if (locationMarker) {
            map.removeOverLay(locationMarker);
        }
        locationMarker = new T.Marker(new T.LngLat(log, lastLat), { icon: icon });
        map.addOverLay(locationMarker);
             // 移动地图视角到最后一个位置
             map.panTo(newPoint);
        // }, 500);
@@ -289,4 +299,3 @@
})();