File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -4820,10 +4820,6 @@ export class WebMap extends Observable {
4820
4820
// const origin = [envelope.left, envelope.top];
4821
4821
let baseUrl = layerInfo . url ;
4822
4822
let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
4823
- let spriteUrl = styles . sprite ;
4824
- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
4825
- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
4826
- }
4827
4823
if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
4828
4824
Object . keys ( styles . sources ) . forEach ( function ( key ) {
4829
4825
Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -4836,7 +4832,12 @@ export class WebMap extends Observable {
4836
4832
} ) ;
4837
4833
} ) ;
4838
4834
}
4839
- let withCredentials = this . isIportalProxyServiceUrl ( spriteUrl ) ;
4835
+ let sourceName = Object . keys ( styles . sources ) [ 0 ] ;
4836
+ let checkUrl = styles . sources [ sourceName ] . url || styles . sources [ sourceName ] . tiles [ 0 ] ;
4837
+ if ( checkUrl && ! CommonUtil . isAbsoluteURL ( checkUrl ) ) {
4838
+ checkUrl = CommonUtil . relative2absolute ( checkUrl , baseUrl ) ;
4839
+ }
4840
+ let withCredentials = CommonUtil . isInTheSameDomain ( checkUrl ) || this . isIportalProxyServiceUrl ( checkUrl ) ;
4840
4841
// 创建MapBoxStyle样式
4841
4842
let mapboxStyles = new MapboxStyles ( {
4842
4843
baseUrl,
You can’t perform that action at this time.
0 commit comments