|
@@ -8,6 +8,7 @@ import AccountAuth from '../model/AccountAuth';
|
|
|
import PresetsManager from '../ctrl/PresetsManager';
|
|
|
import PubSub from 'pubsub-js';
|
|
|
import VectorDataManager from '../ctrl/VectorDataManager';
|
|
|
+import LocationCard from './common/LocationCard';
|
|
|
// import request from 'request-promise-native';
|
|
|
|
|
|
|
|
@@ -19,6 +20,7 @@ export default class App {
|
|
|
constructor(params) {
|
|
|
this.el = params.el
|
|
|
this.id = params.id
|
|
|
+ this.url = params.url
|
|
|
}
|
|
|
|
|
|
init() {
|
|
@@ -110,7 +112,7 @@ export default class App {
|
|
|
// this.authWait = setInterval(this._checkAuth.bind(this), 100);
|
|
|
// }
|
|
|
|
|
|
- window.editor_user_auth = new AccountAuth();
|
|
|
+ window.editor_user_auth = new AccountAuth(this.url);
|
|
|
|
|
|
/**
|
|
|
* Event for logging in user
|
|
@@ -295,4 +297,17 @@ export default class App {
|
|
|
return {};
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ /** * 更新标记位置 * *
|
|
|
+ * @param {Object} data - 根据data.type类型,将不同的标记按照data.data移动 *
|
|
|
+ */
|
|
|
+ moveMarker(data) {
|
|
|
+ if (data.type === "card") {
|
|
|
+ let cards = data.data.map(card => {
|
|
|
+ return new LocationCard(card.lat, card.lng, card.loc_time, card.milli_time, card.card_id, card.info, card.src);
|
|
|
+ });
|
|
|
+ PubSub.publish('body.data.update', cards);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|