Skip to content

Commit

Permalink
fix 轨迹回放模板、xx园区模板地图缩放层级不对
Browse files Browse the repository at this point in the history
  • Loading branch information
chenxianhuii committed May 23, 2024
1 parent 0254913 commit a9a27c2
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
4 changes: 0 additions & 4 deletions src/mapboxgl/web-map/WebMapViewModel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -643,10 +643,6 @@ export default class WebMapViewModel extends Events {
this._handler.clean();
this._handler = null;
this.map = null;
if (this.mapOptions) {
this.mapOptions.zoom = null;
this.mapOptions.center = null;
}
}
}

Expand Down
16 changes: 16 additions & 0 deletions src/mapboxgl/web-map/__tests__/WebMapViewModel.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2265,4 +2265,20 @@ describe('WebMapViewModel.spec', () => {
await flushPromises();
jest.advanceTimersByTime(0);
})

it('not clean zoom', done => {
const fetchResource = {
'https://fakeiportal.supermap.io/iportal/web/datas/123456/content.json?pageSize=9999999&currentPage=1&parentResType=MAP&parentResId=undefined':
layerData_geojson['MARKER_GEOJSON']
};
mockFetch(fetchResource);
const id = markerLayer;
const viewModel = new WebMapViewModel(id, { ...commonOption }, { ...commonMapOptions }, { ...commonMap });
const callback = function (data) {
viewModel.setStyle({});
expect(viewModel.mapOptions.zoom).not.toBeNull();
done();
};
viewModel.on({ addlayerssucceeded: callback });
});
});

0 comments on commit a9a27c2

Please sign in to comment.