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 @@ -5132,9 +5132,6 @@ export class WebMap extends Observable {
51325132 let baseUrl = layerInfo . url ;
51335133 let paramUrl = baseUrl . split ( '?' ) [ 1 ] ;
51345134 let spriteUrl = styles . sprite ;
5135- if ( ! CommonUtil . isAbsoluteURL ( styles . sprite ) ) {
5136- spriteUrl = CommonUtil . relative2absolute ( styles . sprite , baseUrl ) ;
5137- }
51385135 if ( layerInfo . dataSource . type === 'ARCGIS_VECTORTILE' ) {
51395136 Object . keys ( styles . sources ) . forEach ( function ( key ) {
51405137 Object . keys ( styles . sources [ key ] ) . forEach ( function ( fieldName ) {
@@ -5147,7 +5144,12 @@ export class WebMap extends Observable {
51475144 } ) ;
51485145 } ) ;
51495146 }
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 ) ;
51515153 const requestParameters = this . tileRequestParameters && this . tileRequestParameters ( spriteUrl ) ;
51525154 // 创建MapBoxStyle样式
51535155 let mapboxStyles = new MapboxStyles ( {
You can’t perform that action at this time.
0 commit comments