@@ -428,7 +428,7 @@ export class WebMap extends Observable {
428428 zoom : 0 ,
429429 projection : proj
430430 }
431- if ( ! [ '4' , '5' ] . includes ( Util . getOlVersion ( ) ) ) { // 兼容 ol 4,5,6
431+ if ( [ '4' , '5' ] . indexOf ( Util . getOlVersion ( ) ) < 0 ) { // 兼容 ol 4,5,6
432432 viewOptions . multiWorld = true ;
433433 }
434434 let view = new View ( viewOptions ) ;
@@ -645,7 +645,7 @@ export class WebMap extends Observable {
645645 if ( ( baseLayer . visibleScales && baseLayer . visibleScales . length > 0 ) || ( baseLayer . scales && baseLayer . scales . length > 0 ) ) {
646646 //底图有固定比例尺,就直接获取。不用view计算
647647 this . getScales ( baseLayer ) ;
648- } else if ( options . baseLayer && [ 'TILE' , 'VECTOR_TILE' ] . includes ( options . baseLayer . layerType ) && extent && extent . length === 4 ) {
648+ } else if ( options . baseLayer && [ 'TILE' , 'VECTOR_TILE' ] . indexOf ( options . baseLayer . layerType ) > - 1 && extent && extent . length === 4 ) {
649649 let width = extent [ 2 ] - extent [ 0 ] ;
650650 let height = extent [ 3 ] - extent [ 1 ] ;
651651 let maxResolution1 = width / 512 ;
@@ -673,7 +673,7 @@ export class WebMap extends Observable {
673673 this . getScales ( baseLayer ) ;
674674 }
675675 }
676- if ( ! [ '4' , '5' ] . includes ( Util . getOlVersion ( ) ) ) { // 兼容 ol 4,5,6
676+ if ( [ '4' , '5' ] . indexOf ( Util . getOlVersion ( ) ) < 0 ) { // 兼容 ol 4,5,6
677677 viewOptions . multiWorld = true ;
678678 viewOptions . showFullExtent = true ;
679679 viewOptions . enableRotation = false ;
@@ -1272,7 +1272,7 @@ export class WebMap extends Observable {
12721272 }
12731273 //bug wmts出图需要加上origin,否则会出现出图不正确的情况。偏移或者瓦片出不了
12741274 let origin = tileMatrixSet [ i ] . TileMatrix [ 0 ] . TopLeftCorner ;
1275- layerInfo . origin = [ "EPSG:4326" , "EPSG:4490" ] . includes ( wmtsLayerEpsg ) ? [ origin [ 1 ] , origin [ 0 ] ] : origin ;
1275+ layerInfo . origin = [ "EPSG:4326" , "EPSG:4490" ] . indexOf ( wmtsLayerEpsg ) > - 1 ? [ origin [ 1 ] , origin [ 0 ] ] : origin ;
12761276 break ;
12771277 }
12781278 }
@@ -1961,7 +1961,7 @@ export class WebMap extends Observable {
19611961 let field = colTitles [ j ] ;
19621962 if ( field === undefined || field === null ) { continue ; }
19631963 field = field . trim ( ) ;
1964- if ( Object . keys ( attributes ) . includes ( field ) ) {
1964+ if ( Object . keys ( attributes ) . indexOf ( field ) > - 1 ) {
19651965 //说明前面有个一模一样的字段
19661966 const newField = field + '_1' ;
19671967 attributes [ newField ] = rowDatas [ j ] ;
@@ -2402,10 +2402,10 @@ export class WebMap extends Observable {
24022402 lineDash : 'solid' ,
24032403 type : "BASIC_POINT"
24042404 } ;
2405- if ( [ "LINE" , "LINESTRING" , "MULTILINESTRING" ] . includes ( featureType ) ) {
2405+ if ( [ "LINE" , "LINESTRING" , "MULTILINESTRING" ] . indexOf ( featureType ) > - 1 ) {
24062406 styleParameters . strokeColor = '#4CC8A3' ;
24072407 styleParameters . strokeWidth = 2 ;
2408- } else if ( [ "REGION" , "POLYGON" , "MULTIPOLYGON" ] . includes ( featureType ) ) {
2408+ } else if ( [ "REGION" , "POLYGON" , "MULTIPOLYGON" ] . indexOf ( featureType ) > - 1 ) {
24092409 styleParameters . fillColor = '#826DBA' ;
24102410 }
24112411 return styleParameters ;
0 commit comments