Skip to content

Commit 160c34d

Browse files
committed
[bug] 修复合并后自测的缺陷
1. WMTS出图失败 2. 请求RestMap地址未勾选代理,但是请求带了代理地址
1 parent 0cbd04b commit 160c34d

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/openlayers/mapping/WebMap.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -1584,7 +1584,7 @@ export class WebMap extends Observable {
15841584
getWmtsInfo(layerInfo, callback) {
15851585
let that = this;
15861586
let options = {
1587-
withCredentials: that.isCredentail(layerInfo.proxy),
1587+
withCredentials: that.isCredentail(layerInfo.url, layerInfo.proxy),
15881588
withoutFormatSuffix: true
15891589
};
15901590
const isKvp = !layerInfo.requestEncoding || layerInfo.requestEncoding === 'KVP';
@@ -4892,9 +4892,9 @@ export class WebMap extends Observable {
48924892
url = this.getRequestUrl(url + '.json');
48934893
}
48944894
if (url.indexOf('/restjsr/') > -1 && !/\.json$/.test(url)) {
4895-
url = this.getRequestUrl(url + '.json');
4895+
url = this.getRequestUrl(url + '.json', layerInfo.proxy);
48964896
} else {
4897-
url = this.getRequestUrl(url);
4897+
url = this.getRequestUrl(url, layerInfo.proxy);
48984898
}
48994899

49004900
let credential = layerInfo.credential;
@@ -4907,7 +4907,7 @@ export class WebMap extends Observable {
49074907
}
49084908

49094909
return FetchRequest.get(url, null, {
4910-
withCredentials: this.isCredentail(url),
4910+
withCredentials: this.isCredentail(url, layerInfo.proxy),
49114911
withoutFormatSuffix: true,
49124912
headers: {
49134913
'Content-Type': 'application/json;chartset=uft-8'
@@ -4958,7 +4958,7 @@ export class WebMap extends Observable {
49584958
if (styleUrl.indexOf('/restjsr/') > -1 && !/\/style\.json$/.test(url)) {
49594959
styleUrl = `${styleUrl}/style.json`;
49604960
}
4961-
styleUrl = this.getRequestUrl(styleUrl);
4961+
styleUrl = this.getRequestUrl(styleUrl, layerInfo.proxy);
49624962
let credential = layerInfo.credential;
49634963
//携带令牌(restmap用的首字母大写,但是这里要用小写)
49644964
let credentialValue, keyfix;
@@ -4969,7 +4969,7 @@ export class WebMap extends Observable {
49694969
}
49704970

49714971
return FetchRequest.get(styleUrl, null, {
4972-
withCredentials: this.isCredentail(styleUrl),
4972+
withCredentials: this.isCredentail(styleUrl, layerInfo.proxy),
49734973
withoutFormatSuffix: true,
49744974
headers: {
49754975
'Content-Type': 'application/json;chartset=uft-8'

0 commit comments

Comments
 (0)