zoom fix
This commit is contained in:
parent
54a1b0da76
commit
0ee3f77d9e
@ -373,8 +373,12 @@ export default abstract class LeafletMap {
|
||||
updatePolyline(key: string, data: FormattedData[], dataSources: FormattedData[], settings: PolylineSettings) {
|
||||
this.ready$.subscribe(() => {
|
||||
const poly = this.polylines.get(key);
|
||||
const oldBounds = poly.leafletPoly.getBounds();
|
||||
poly.updatePolyline(settings, data.map(el => this.convertPosition(el)), dataSources);
|
||||
const bounds = poly.leafletPoly.getBounds();
|
||||
const newBounds = poly.leafletPoly.getBounds();
|
||||
if (oldBounds.toBBoxString() !== newBounds.toBBoxString()) {
|
||||
this.fitBounds(newBounds);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@ -408,7 +412,12 @@ export default abstract class LeafletMap {
|
||||
updatePolygon(polyData: FormattedData, dataSources: FormattedData[], settings: PolygonSettings) {
|
||||
this.ready$.subscribe(() => {
|
||||
const poly = this.polygons.get(polyData.entityName);
|
||||
const oldBounds = poly.leafletPoly.getBounds();
|
||||
poly.updatePolygon(polyData, dataSources, settings);
|
||||
const newBounds = poly.leafletPoly.getBounds();
|
||||
if (oldBounds.toBBoxString() !== newBounds.toBBoxString()) {
|
||||
this.fitBounds(newBounds);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ export function parseArray(input: any[]): any[] {
|
||||
time: el[0],
|
||||
deviceType: null
|
||||
};
|
||||
entityArray.filter(e => e.data.length).forEach(entity => {
|
||||
entityArray.filter(e => e.data.length && e.data[i]).forEach(entity => {
|
||||
obj[entity?.dataKey?.label] = entity?.data[i][1];
|
||||
obj[entity?.dataKey?.label + '|ts'] = entity?.data[0][0];
|
||||
if (entity?.dataKey?.label === 'type') {
|
||||
|
||||
@ -110,7 +110,10 @@ export class TripAnimationComponent implements OnInit, AfterViewInit {
|
||||
timeUpdated(time: number) {
|
||||
this.minTime = moment(this.intervals[this.intervals.length - 1]).format('YYYY-MM-DD HH:mm:ss');
|
||||
this.maxTime = moment(this.intervals[0]).format('YYYY-MM-DD HH:mm:ss');
|
||||
const currentPosition = this.interpolatedData.map(dataSource => dataSource[time]).map(ds => {
|
||||
const currentPosition = this.interpolatedData
|
||||
.map(dataSource => dataSource[time])
|
||||
.filter(ds => ds)
|
||||
.map(ds => {
|
||||
ds.minTime = this.minTime;
|
||||
ds.maxTime = this.maxTime;
|
||||
return ds;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user