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 @@ -5174,9 +5174,6 @@ export class WebMap extends Observable {
5174
5174
let baseUrl = layerInfo . url ;
5175
5175
let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
5176
5176
let spriteUrl = styles . sprite ;
5177
- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
5178
- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
5179
- }
5180
5177
if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
5181
5178
Object . keys ( styles . sources ) . forEach ( function ( key ) {
5182
5179
Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -5189,7 +5186,12 @@ export class WebMap extends Observable {
5189
5186
} ) ;
5190
5187
} ) ;
5191
5188
}
5192
- let withCredentials = this . isIportalProxyServiceUrl ( spriteUrl ) ;
5189
+ let sourceName = Object . keys ( styles . sources ) [ 0 ] ;
5190
+ let checkUrl = styles . sources [ sourceName ] . url || styles . sources [ sourceName ] . tiles [ 0 ] ;
5191
+ if ( checkUrl && ! CommonUtil . isAbsoluteURL ( checkUrl ) ) {
5192
+ checkUrl = CommonUtil . relative2absolute ( checkUrl , baseUrl ) ;
5193
+ }
5194
+ let withCredentials = CommonUtil . isInTheSameDomain ( checkUrl ) || this . isIportalProxyServiceUrl ( checkUrl ) ;
5193
5195
const requestParameters = this . tileRequestParameters && this . tileRequestParameters ( spriteUrl ) ;
5194
5196
// 创建MapBoxStyle样式
5195
5197
let mapboxStyles = new MapboxStyles ( {
You can’t perform that action at this time.
0 commit comments