File tree 1 file changed +6
-4
lines changed
1 file changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -5132,9 +5132,6 @@ export class WebMap extends Observable {
5132
5132
let baseUrl = layerInfo . url ;
5133
5133
let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
5134
5134
let spriteUrl = styles . sprite ;
5135
- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
5136
- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
5137
- }
5138
5135
if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
5139
5136
Object . keys ( styles . sources ) . forEach ( function ( key ) {
5140
5137
Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -5147,7 +5144,12 @@ export class WebMap extends Observable {
5147
5144
} ) ;
5148
5145
} ) ;
5149
5146
}
5150
- let withCredentials = this . isIportalProxyServiceUrl ( spriteUrl ) ;
5147
+ let sourceName = Object . keys ( styles . sources ) [ 0 ] ;
5148
+ let checkUrl = styles . sources [ sourceName ] . url || styles . sources [ sourceName ] . tiles [ 0 ] ;
5149
+ if ( checkUrl && ! CommonUtil . isAbsoluteURL ( checkUrl ) ) {
5150
+ checkUrl = CommonUtil . relative2absolute ( checkUrl , baseUrl ) ;
5151
+ }
5152
+ let withCredentials = CommonUtil . isInTheSameDomain ( checkUrl ) || this . isIportalProxyServiceUrl ( checkUrl ) ;
5151
5153
const requestParameters = this . tileRequestParameters && this . tileRequestParameters ( spriteUrl ) ;
5152
5154
// 创建MapBoxStyle样式
5153
5155
let mapboxStyles = new MapboxStyles ( {
You can’t perform that action at this time.
0 commit comments