File tree Expand file tree Collapse file tree 1 file changed +6
-4
lines changed Expand file tree Collapse file tree 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 {
51745174 let baseUrl = layerInfo . url ;
51755175 let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
51765176 let spriteUrl = styles . sprite ;
5177- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
5178- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
5179- }
51805177 if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
51815178 Object . keys ( styles . sources ) . forEach ( function ( key ) {
51825179 Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -5189,7 +5186,12 @@ export class WebMap extends Observable {
51895186 } ) ;
51905187 } ) ;
51915188 }
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 ) ;
51935195 const requestParameters = this . tileRequestParameters && this . tileRequestParameters ( spriteUrl ) ;
51945196 // 创建MapBoxStyle样式
51955197 let mapboxStyles = new MapboxStyles ( {
You can’t perform that action at this time.
0 commit comments