File tree 2 files changed +7
-5
lines changed
2 files changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -5206,9 +5206,6 @@ export class WebMap extends Observable {
5206
5206
let baseUrl = layerInfo . url ;
5207
5207
let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
5208
5208
let spriteUrl = styles . sprite ;
5209
- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
5210
- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
5211
- }
5212
5209
if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
5213
5210
Object . keys ( styles . sources ) . forEach ( function ( key ) {
5214
5211
Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -5221,7 +5218,12 @@ export class WebMap extends Observable {
5221
5218
} ) ;
5222
5219
} ) ;
5223
5220
}
5224
- let withCredentials = this . isIportalProxyServiceUrl ( spriteUrl ) ;
5221
+ let sourceName = Object . keys ( styles . sources ) [ 0 ] ;
5222
+ let checkUrl = styles . sources [ sourceName ] . url || styles . sources [ sourceName ] . tiles [ 0 ] ;
5223
+ if ( checkUrl && ! CommonUtil . isAbsoluteURL ( checkUrl ) ) {
5224
+ checkUrl = CommonUtil . relative2absolute ( checkUrl , baseUrl ) ;
5225
+ }
5226
+ let withCredentials = CommonUtil . isInTheSameDomain ( checkUrl ) || this . isIportalProxyServiceUrl ( checkUrl ) ;
5225
5227
const requestParameters = this . tileRequestParameters && this . tileRequestParameters ( spriteUrl ) ;
5226
5228
// 创建MapBoxStyle样式
5227
5229
let mapboxStyles = new MapboxStyles ( {
Original file line number Diff line number Diff line change 411
411
} )
412
412
}
413
413
if ( fieldName === 'sprite' || fieldName === 'glyphs' || fieldName === 'url' ) {
414
- if ( typeof styles [ fieldName ] === 'string' && ! CommonUtil . isAbsoluteURL ( styles [ fieldName ] ) ) {
414
+ if ( styles [ fieldName ] && typeof styles [ fieldName ] === 'string' && ! CommonUtil . isAbsoluteURL ( styles [ fieldName ] ) ) {
415
415
styles [ fieldName ] = CommonUtil . relative2absolute ( styles [ fieldName ] , baseUrl ) ;
416
416
}
417
417
if ( paramUrl && ! styles [ fieldName ] . includes ( paramUrl ) ) {
You can’t perform that action at this time.
0 commit comments