@@ -949,6 +949,13 @@ describe('mapboxgl-webmap3.0', () => {
949949 } ) ;
950950
951951 it ( 'label legend' , ( done ) => {
952+ const mapInfo = JSON . parse ( mapstudioWebMap_labelLegend ) ;
953+ spyOn ( L7 , 'PointLayer' ) . and . callFake ( mockL7 . PointLayer ) ;
954+ spyOn ( L7 , 'LineLayer' ) . and . callFake ( mockL7 . PointLayer ) ;
955+ spyOn ( L7 , 'PolygonLayer' ) . and . callFake ( mockL7 . PointLayer ) ;
956+ spyOn ( L7 , 'HeatmapLayer' ) . and . callFake ( mockL7 . PointLayer ) ;
957+ spyOn ( L7 , 'Scene' ) . and . callFake ( mockL7 . Scene ) ;
958+ spyOn ( L7 , 'Mapbox' ) . and . callFake ( mockL7 . Mapbox ) ;
952959 spyOn ( FetchRequest , 'get' ) . and . callFake ( ( url ) => {
953960 if ( url . indexOf ( 'map.json' ) > - 1 ) {
954961 return Promise . resolve ( new Response ( mapstudioWebMap_labelLegend ) ) ;
@@ -959,14 +966,18 @@ describe('mapboxgl-webmap3.0', () => {
959966 }
960967 return Promise . resolve ( ) ;
961968 } ) ;
969+ mapboxgl . Map . prototype . getCRS = function ( ) {
970+ return { epsgCode : 'EPSG:3857' , getExtent : ( ) => { } } ;
971+ } ;
962972 mapstudioWebmap = new WebMap ( id , {
963973 server : server
964974 } ) ;
965975
966976 mapstudioWebmap . on ( 'addlayerssucceeded' , ( { map } ) => {
967977 const webMapV3 = mapstudioWebmap . _getWebMapInstance ( ) ;
968978 expect ( map ) . not . toBeUndefined ( ) ;
969- expect ( webMapV3 . getLegendInfo ( ) . length ) . toBe ( 6 ) ;
979+ expect ( webMapV3 . getLegendInfo ( ) . length ) . toBe ( 9 ) ;
980+ delete mapboxgl . Map . prototype . getCRS ;
970981 done ( ) ;
971982 } ) ;
972983 } ) ;
0 commit comments