Skip to content

Commit b13054a

Browse files
committed
[fix]修复ol webmap添加没有serverId的图层时,阻断了后面layer的添加的问题 review by luox
# Conflicts: # test/resources/WebMapV5.js
1 parent 1c36f7d commit b13054a

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1945,7 +1945,7 @@ export class WebMap extends Observable {
19451945
await that.addLayer(layer, null, layerIndex);
19461946
that.layerAdded++;
19471947
that.sendMapToUser(len);
1948-
return;
1948+
continue;
19491949
}
19501950
if (
19511951
layer.layerType === 'MARKER' ||

test/openlayers/mapping/WebMapSpec.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1919,5 +1919,25 @@ describe('openlayers_WebMap', () => {
19191919
}, 500);
19201920
}
19211921
});
1922+
it('datavizWebMap_noServerIdMarker', (done) => {
1923+
let options = {
1924+
server: server,
1925+
webMap: defaultServeRequest,
1926+
successCallback,
1927+
errorCallback: function () { }
1928+
};
1929+
spyOn(FetchRequest, 'get').and.callFake((url) => {
1930+
if (url.indexOf('map.json') > -1) {
1931+
var mapJson = datavizWebMap_noServerIdMarker;
1932+
return Promise.resolve(new Response(mapJson));
1933+
}
1934+
return Promise.resolve();
1935+
});
1936+
var datavizWebmap = new WebMap(options);
1937+
function successCallback() {
1938+
expect(datavizWebmap.server).toBe(server);
1939+
done();
1940+
}
1941+
});
19221942

19231943
});

test/resources/WebMapV5.js

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy