Skip to content

Commit e90e64c

Browse files
committed
【fix】UT
1 parent b74291e commit e90e64c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

test/leaflet/overlay/GraphicLayerSpec.js

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ describe('leaflet_GraphicLayer', () => {
2929
graphics[j].setAttributes({ name: 'graphic_' + j });
3030
}
3131
});
32-
function createMap() {
32+
function createMap(crs) {
3333
testDiv = window.document.createElement('div');
3434
testDiv.setAttribute('id', 'map');
3535
testDiv.style.styleFloat = 'left';
@@ -41,7 +41,7 @@ describe('leaflet_GraphicLayer', () => {
4141

4242
map = L.map('map', {
4343
preferCanvas: true,
44-
crs: L.CRS.EPSG4326,
44+
crs: crs || L.CRS.EPSG4326,
4545
center: { lon: 0, lat: 0 },
4646
maxZoom: 18,
4747
zoom: 1
@@ -362,8 +362,7 @@ describe('leaflet_GraphicLayer', () => {
362362
}, 0);
363363
});
364364
it('Mercator_ICL_1349', (done) => {
365-
let { map, testDiv } = createMap();
366-
map.options.crs = L.CRS.TianDiTu_Mercator;
365+
let { map, testDiv } = createMap(L.CRS.TianDiTu_Mercator);
367366
let layer = graphicLayer(graphics, { render: 'webgl' }).addTo(map);
368367
setTimeout(() => {
369368
expect(layer._crs).toEqual(map.options.crs);
@@ -381,8 +380,7 @@ describe('leaflet_GraphicLayer', () => {
381380
}, 0);
382381
});
383382
it('CRS_4326_ICL_1349', (done) => {
384-
let { map, testDiv } = createMap();
385-
map.options.crs = L.CRS.TianDiTu_WGS84;
383+
let { map, testDiv } = createMap(L.CRS.TianDiTu_WGS84);
386384
let layer = graphicLayer(graphics, { render: 'webgl' }).addTo(map);
387385
setTimeout(() => {
388386
expect(layer._crs).toEqual(map.options.crs);

0 commit comments

Comments
 (0)