Skip to content

Commit 5128539

Browse files
committed
fix ms 地图代理服务不出图
1 parent 521f927 commit 5128539

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/common/mapping/WebMapV3.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ export function createWebMapV3Extending(SuperClass, { MapManager, mapRepo, mapRe
314314
}
315315
return (url, resourceType) => {
316316
if (resourceType === 'Tile') {
317-
const withCredentials = this.options.iportalServiceProxyUrl && url.indexOf(this.options.iportalServiceProxyUrl) >= 0;
317+
const withCredentials = this.options.iportalServiceProxyUrlPrefix && url.indexOf(this.options.iportalServiceProxyUrlPrefix) >= 0;
318318
return {
319319
url: url,
320320
credentials: withCredentials ? 'include' : undefined,

src/common/mapping/utils/L7LayerUtil.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,7 @@ export function L7LayerUtil(config) {
426426
}
427427

428428
function isIportalProxyServiceUrl(url, options) {
429-
return options.iportalServiceProxyUrl && url.indexOf(options.iportalServiceProxyUrl) >= 0;
429+
return options.iportalServiceProxyUrlPrefix && url.indexOf(options.iportalServiceProxyUrlPrefix) >= 0;
430430
}
431431

432432
function handleWithRequestOptions(url, options) {

test/common/mapping/utils/L7LayerUtilSpec.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,7 @@ describe('L7LayerUtil', () => {
517517
...addOptions.options,
518518
withCredentials: false,
519519
server: '/iportal/',
520-
iportalServiceProxyUrl: 'http://localhost:8195/portalproxy'
520+
iportalServiceProxyUrlPrefix: 'http://localhost:8195/portalproxy'
521521
}
522522
};
523523
const spy = spyOn(nextOptions.map, 'addLayer').and.callThrough();

test/mapboxgl/mapping/WebMapV3Spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('mapboxgl-webmap3.0', () => {
100100
});
101101
mapstudioWebmap = new WebMap(id, {
102102
server: server,
103-
iportalServiceProxyUrl: 'initialize_raster'
103+
iportalServiceProxyUrlPrefix: 'initialize_raster'
104104
});
105105
expect(mapstudioWebmap.credentialKey).toBeUndefined();
106106
expect(mapstudioWebmap.credentialValue).toBeUndefined();
@@ -202,7 +202,7 @@ describe('mapboxgl-webmap3.0', () => {
202202
mapstudioWebmap = new WebMapV3(mapInfo, {
203203
server: server,
204204
target: 'map',
205-
iportalServiceProxyUrl: 'mapId is JSON'
205+
iportalServiceProxyUrlPrefix: 'mapId is JSON'
206206
});
207207
mapstudioWebmap.initializeMap(mapInfo);
208208

@@ -273,7 +273,7 @@ describe('mapboxgl-webmap3.0', () => {
273273
mapstudioWebmap = new WebMapV3(nextMapInfo, {
274274
server: server,
275275
target: 'map',
276-
iportalServiceProxyUrl: 'projection is 4490 and include mapbox-gl-enhance'
276+
iportalServiceProxyUrlPrefix: 'projection is 4490 and include mapbox-gl-enhance'
277277
});
278278
mapstudioWebmap.initializeMap(nextMapInfo);
279279

@@ -363,7 +363,7 @@ describe('mapboxgl-webmap3.0', () => {
363363
mapstudioWebmap = new WebMapV3(mapInfo, {
364364
server: server,
365365
target: 'map',
366-
iportalServiceProxyUrl: 'overlayLayersManager'
366+
iportalServiceProxyUrlPrefix: 'overlayLayersManager'
367367
});
368368
mapstudioWebmap.initializeMap(mapInfo);
369369

@@ -521,7 +521,7 @@ describe('mapboxgl-webmap3.0', () => {
521521
mapstudioWebmap = new WebMapV3(mapInfo, {
522522
server: server,
523523
target: 'map',
524-
iportalServiceProxyUrl: 'exclude source and layer'
524+
iportalServiceProxyUrlPrefix: 'exclude source and layer'
525525
});
526526
mapstudioWebmap.initializeMap(mapInfo);
527527

@@ -735,14 +735,14 @@ describe('mapboxgl-webmap3.0', () => {
735735
});
736736
const spyTest = spyOn(MapManagerUtil, 'default').and.callFake(mbglmap);
737737
const mapInfo = JSON.parse(mapstudioWebMap_raster);
738-
const iportalServiceProxyUrl = 'http://localhost:8195/portalproxy';
738+
const iportalServiceProxyUrlPrefix = 'http://localhost:8195/portalproxy';
739739
const tileCustomRequestHeaders = { 'Authorization': 'test token' };
740740
mapstudioWebmap = new WebMap(mapInfo, {
741741
server: server,
742742
target: 'map',
743-
iportalServiceProxyUrl,
743+
iportalServiceProxyUrlPrefix,
744744
tileTransformRequest: (url) => {
745-
if (url.includes(iportalServiceProxyUrl)) {
745+
if (url.includes(iportalServiceProxyUrlPrefix)) {
746746
return { headers: tileCustomRequestHeaders };
747747
}
748748
}

test/maplibregl/mapping/WebMapV3Spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe('maplibregl-webmap3.0', () => {
100100
});
101101
mapstudioWebmap = new WebMap(id, {
102102
server: server,
103-
iportalServiceProxyUrl: 'initialize_raster'
103+
iportalServiceProxyUrlPrefix: 'initialize_raster'
104104
});
105105
expect(mapstudioWebmap.credentialKey).toBeUndefined();
106106
expect(mapstudioWebmap.credentialValue).toBeUndefined();
@@ -167,7 +167,7 @@ describe('maplibregl-webmap3.0', () => {
167167
mapstudioWebmap = new WebMapV3(mapInfo, {
168168
server: server,
169169
target: 'map',
170-
iportalServiceProxyUrl: 'mapId is JSON'
170+
iportalServiceProxyUrlPrefix: 'mapId is JSON'
171171
});
172172
mapstudioWebmap.initializeMap(mapInfo);
173173

@@ -238,7 +238,7 @@ describe('maplibregl-webmap3.0', () => {
238238
mapstudioWebmap = new WebMapV3(nextMapInfo, {
239239
server: server,
240240
target: 'map',
241-
iportalServiceProxyUrl: 'projection is 4490 and include maplibre-gl-enhance'
241+
iportalServiceProxyUrlPrefix: 'projection is 4490 and include maplibre-gl-enhance'
242242
});
243243
mapstudioWebmap.initializeMap(nextMapInfo);
244244

@@ -328,7 +328,7 @@ describe('maplibregl-webmap3.0', () => {
328328
mapstudioWebmap = new WebMapV3(mapInfo, {
329329
server: server,
330330
target: 'map',
331-
iportalServiceProxyUrl: 'overlayLayersManager'
331+
iportalServiceProxyUrlPrefix: 'overlayLayersManager'
332332
});
333333
mapstudioWebmap.initializeMap(mapInfo);
334334

@@ -486,7 +486,7 @@ describe('maplibregl-webmap3.0', () => {
486486
mapstudioWebmap = new WebMapV3(mapInfo, {
487487
server: server,
488488
target: 'map',
489-
iportalServiceProxyUrl: 'exclude source and layer'
489+
iportalServiceProxyUrlPrefix: 'exclude source and layer'
490490
});
491491
mapstudioWebmap.initializeMap(mapInfo);
492492

@@ -700,14 +700,14 @@ describe('maplibregl-webmap3.0', () => {
700700
});
701701
const spyTest = spyOn(MapManagerUtil, 'default').and.callFake(mbglmap);
702702
const mapInfo = JSON.parse(mapstudioWebMap_raster);
703-
const iportalServiceProxyUrl = 'http://localhost:8195/portalproxy';
703+
const iportalServiceProxyUrlPrefix = 'http://localhost:8195/portalproxy';
704704
const tileCustomRequestHeaders = { 'Authorization': 'test token' };
705705
mapstudioWebmap = new WebMap(mapInfo, {
706706
server: server,
707707
target: 'map',
708-
iportalServiceProxyUrl,
708+
iportalServiceProxyUrlPrefix,
709709
tileTransformRequest: (url) => {
710-
if (url.includes(iportalServiceProxyUrl)) {
710+
if (url.includes(iportalServiceProxyUrlPrefix)) {
711711
return { headers: tileCustomRequestHeaders };
712712
}
713713
}

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