|
@@ -1,5 +1,7 @@
|
|
import PubSub from "pubsub-js";
|
|
import PubSub from "pubsub-js";
|
|
import HistoryTrack from "../layers/HistoryTrack";
|
|
import HistoryTrack from "../layers/HistoryTrack";
|
|
|
|
+import App from "../App";
|
|
|
|
+import MapUtil from "./MapUtil";
|
|
|
|
|
|
export default class HistoryTrackControl{
|
|
export default class HistoryTrackControl{
|
|
/**
|
|
/**
|
|
@@ -56,6 +58,10 @@ export default class HistoryTrackControl{
|
|
*/
|
|
*/
|
|
setHistoryPath(path, src, multi = 1){
|
|
setHistoryPath(path, src, multi = 1){
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
|
|
+ path = path.map(point => {
|
|
|
|
+ let latlng = MapUtil.moveLatLng(App.center, point.x, point.y);
|
|
|
|
+ return {lat: latlng.lat, lng: latlng.lng, time: point.time};
|
|
|
|
+ });
|
|
PubSub.publish("map.his.set", {path: path, src: src, speedMultiply: multi});
|
|
PubSub.publish("map.his.set", {path: path, src: src, speedMultiply: multi});
|
|
}, 50);
|
|
}, 50);
|
|
}
|
|
}
|