|
@@ -22,15 +22,15 @@ export default class App {
|
|
|
this.el = params.el
|
|
|
this.id = params.id
|
|
|
this.url = params.url
|
|
|
- if(params.center){
|
|
|
- this.center = new LatLng(params.center[0], params.center[1])
|
|
|
+ if(params.origin){
|
|
|
+ this.origin = new LatLng(params.origin[0], params.origin[1])
|
|
|
}else{
|
|
|
- this.center = new LatLng(0, 0)
|
|
|
+ this.origin = new LatLng(0, 0)
|
|
|
}
|
|
|
|
|
|
//静态只读m
|
|
|
- Object.defineProperty(App, 'center', {
|
|
|
- value: this.center,
|
|
|
+ Object.defineProperty(App, 'origin', {
|
|
|
+ value: this.origin,
|
|
|
writable: false,
|
|
|
enumerable: false,
|
|
|
configurable: false
|
|
@@ -301,7 +301,7 @@ export default class App {
|
|
|
moveMarker(data) {
|
|
|
if (data.type === "card") {
|
|
|
let cards = data.data.map(card => {
|
|
|
- let latlng = MapUtil.moveLatLng(App.center, card.x, card.y);
|
|
|
+ let latlng = MapUtil.distancePointToLatLng(App.origin, card.x, card.y);
|
|
|
return new LocationCard(latlng.lat, latlng.lng, card.loc_time, card.milli_time, card.card_id, card.info, card.src);
|
|
|
});
|
|
|
PubSub.publish('body.data.update', cards);
|