Skip to content

Commit 8c65424

Browse files
committed
【update】1) 修复ut 2)webmap请求数据的时候,有token也带上token. (reviewed by songym)
1 parent 90351ae commit 8c65424

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/openlayers/mapping/WebMap.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -867,6 +867,9 @@ export class WebMap extends ol.Observable {
867867
if((layer.layerType === "MARKER") || (dataSource && (!dataSource.accessType || dataSource.accessType === 'DIRECT'))) {
868868
//原来二进制文件
869869
let url = `${that.server}web/datas/${serverId}/content.json?pageSize=9999999&currentPage=1`;
870+
if(that.credentialValue) {
871+
url = `${url}&${that.credentialKey}=${that.credentialValue}`;
872+
}
870873
FetchRequest.get(url, null, {
871874
withCredentials: this.withCredentials
872875
}).then(function (response) {

test/openlayers/mapping/WebMapSpec.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import {
1212
import {
1313
Util
1414
} from '../../../src/openlayers/core/Util';
15+
import {StyleUtils} from "../../../src/openlayers/core/StyleUtils";
1516

1617
describe('openlayers_WebMap', () => {
1718
var originalTimeout, testDiv, webMap;
@@ -424,6 +425,7 @@ describe('openlayers_WebMap', () => {
424425
});
425426
spyOn(options, 'successCallback');
426427
var datavizWebmap = new WebMap(id, options);
428+
spyOn(datavizWebmap, 'createGraphicLayer');
427429

428430
setTimeout(() => {
429431
expect(datavizWebmap.server).toBe(server);
@@ -433,9 +435,9 @@ describe('openlayers_WebMap', () => {
433435

434436
expect(datavizWebmap.mapParams.title).toBe("无标题");
435437
expect(datavizWebmap.mapParams.description).toBe('');
438+
expect(datavizWebmap.createGraphicLayer).toHaveBeenCalled();
436439
expect(options.successCallback).toHaveBeenCalled();
437440
expect(datavizWebmap.map.getLayers().getArray()[0].getProperties().name).toBe('高德地图');
438-
expect(datavizWebmap.map.getLayers().getArray()[1].getProperties().name).toBe('浙江省高等院校(1)');
439441
done();
440442
}, 1000)
441443
});
@@ -457,6 +459,7 @@ describe('openlayers_WebMap', () => {
457459
return Promise.resolve();
458460
});
459461
spyOn(options, 'successCallback');
462+
460463
var datavizWebmap = new WebMap(id, options);
461464

462465
setTimeout(() => {

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