@@ -284,7 +284,9 @@ describe('Test the MapUtils', () => {
284284 hidden : false ,
285285 useForElevation : false ,
286286 origin : undefined ,
287- thematic : undefined
287+ thematic : undefined ,
288+ tooltipOptions : undefined ,
289+ tooltipPlacement : undefined
288290 } ,
289291 {
290292 allowedSRS : { } ,
@@ -328,7 +330,9 @@ describe('Test the MapUtils', () => {
328330 hidden : false ,
329331 useForElevation : false ,
330332 origin : undefined ,
331- thematic : undefined
333+ thematic : undefined ,
334+ tooltipOptions : undefined ,
335+ tooltipPlacement : undefined
332336 } ,
333337 {
334338 allowedSRS : { } ,
@@ -372,7 +376,9 @@ describe('Test the MapUtils', () => {
372376 hidden : false ,
373377 useForElevation : false ,
374378 origin : undefined ,
375- thematic : undefined
379+ thematic : undefined ,
380+ tooltipOptions : undefined ,
381+ tooltipPlacement : undefined
376382 } ,
377383 {
378384 allowedSRS : { } ,
@@ -416,7 +422,9 @@ describe('Test the MapUtils', () => {
416422 hidden : false ,
417423 useForElevation : false ,
418424 origin : [ 100000 , 100000 ] ,
419- thematic : undefined
425+ thematic : undefined ,
426+ tooltipOptions : undefined ,
427+ tooltipPlacement : undefined
420428 } ] ,
421429 mapOptions : { } ,
422430 maxExtent : [ - 20037508.34 , - 20037508.34 , 20037508.34 , 20037508.34 ] ,
@@ -478,7 +486,9 @@ describe('Test the MapUtils', () => {
478486 type : "wms" ,
479487 url : "" ,
480488 visibility : true ,
481- catalogURL : "url"
489+ catalogURL : "url" ,
490+ tooltipOptions : "both" ,
491+ tooltipPlacement : "right"
482492 }
483493 ] ;
484494
@@ -582,7 +592,9 @@ describe('Test the MapUtils', () => {
582592 hidden : false ,
583593 useForElevation : false ,
584594 origin : undefined ,
585- thematic : undefined
595+ thematic : undefined ,
596+ tooltipOptions : undefined ,
597+ tooltipPlacement : undefined
586598 } ,
587599 {
588600 allowedSRS : { } ,
@@ -626,7 +638,9 @@ describe('Test the MapUtils', () => {
626638 hidden : false ,
627639 useForElevation : false ,
628640 origin : undefined ,
629- thematic : undefined
641+ thematic : undefined ,
642+ tooltipOptions : undefined ,
643+ tooltipPlacement : undefined
630644 } ,
631645 {
632646 allowedSRS : { } ,
@@ -670,7 +684,9 @@ describe('Test the MapUtils', () => {
670684 hidden : false ,
671685 useForElevation : false ,
672686 origin : undefined ,
673- thematic : undefined
687+ thematic : undefined ,
688+ tooltipOptions : "both" ,
689+ tooltipPlacement : "right"
674690 } ] ,
675691 mapOptions : {
676692 view : {
@@ -854,7 +870,9 @@ describe('Test the MapUtils', () => {
854870 hidden : false ,
855871 useForElevation : false ,
856872 origin : undefined ,
857- thematic : undefined
873+ thematic : undefined ,
874+ tooltipOptions : undefined ,
875+ tooltipPlacement : undefined
858876 } ,
859877 {
860878 allowedSRS : { } ,
@@ -898,7 +916,9 @@ describe('Test the MapUtils', () => {
898916 hidden : false ,
899917 useForElevation : false ,
900918 origin : undefined ,
901- thematic : undefined
919+ thematic : undefined ,
920+ tooltipOptions : undefined ,
921+ tooltipPlacement : undefined
902922 } ,
903923 {
904924 allowedSRS : { } ,
@@ -942,7 +962,9 @@ describe('Test the MapUtils', () => {
942962 hidden : false ,
943963 useForElevation : false ,
944964 origin : undefined ,
945- thematic : undefined
965+ thematic : undefined ,
966+ tooltipOptions : undefined ,
967+ tooltipPlacement : undefined
946968 } ] ,
947969 mapOptions : { } ,
948970 maxExtent : [ - 20037508.34 , - 20037508.34 , 20037508.34 , 20037508.34 ] ,
@@ -969,6 +991,145 @@ describe('Test the MapUtils', () => {
969991 } ) ;
970992
971993
994+ it ( 'save map configuration with tile matrix and map info configuration' , ( ) => {
995+ const flat = [
996+ {
997+ allowedSRS : { } ,
998+ bbox : { } ,
999+ description : undefined ,
1000+ dimensions : [ ] ,
1001+ id : "layer001" ,
1002+ loading : true ,
1003+ name : "layer001" ,
1004+ params : { } ,
1005+ search : { } ,
1006+ singleTile : false ,
1007+ title : "layer001" ,
1008+ type : "wms" ,
1009+ url : "http:url001" ,
1010+ visibility : true ,
1011+ catalogURL : "url" ,
1012+ matrixIds : {
1013+ 'EPSG:4326' : [ {
1014+ identifier : 'EPSG:4326:0'
1015+ } ]
1016+ } ,
1017+ tileMatrixSet : [ {
1018+ TileMatrix : [ {
1019+ 'ows:Identifier' : 'EPSG:4326:0'
1020+ } ] ,
1021+ 'ows:Identifier' : "EPSG:4326" ,
1022+ 'ows:SupportedCRS' : "urn:ogc:def:crs:EPSG::4326"
1023+ } , {
1024+ TileMatrix : [ {
1025+ 'ows:Identifier' : 'custom:0'
1026+ } ] ,
1027+ 'ows:Identifier' : "custom" ,
1028+ 'ows:SupportedCRS' : "urn:ogc:def:crs:EPSG::900913"
1029+ } ]
1030+ }
1031+ ] ;
1032+ const groups = [
1033+ { expanded : true , id : 'Default' , name : 'Default' , title : 'Default' , nodes : [ 'layer001' , 'layer002' ] } ,
1034+ { expanded : false , id : 'custom' , name : 'custom' , title : 'custom' ,
1035+ nodes : [ { expanded : true , id : 'custom.nested001' , name : 'nested001' , title : 'nested001' , nodes : [ 'layer003' ] }
1036+ ] }
1037+ ] ;
1038+ const mapConfig = {
1039+ center : { x : 0 , y : 0 , crs : 'EPSG:4326' } ,
1040+ maxExtent : [ - 20037508.34 , - 20037508.34 , 20037508.34 , 20037508.34 ] ,
1041+ projection : 'EPSG:900913' ,
1042+ units : 'm' ,
1043+ zoom : 10
1044+ } ;
1045+ const saved = saveMapConfiguration ( mapConfig , flat , groups , '' , { mapInfoConfiguration : { infoFormat : "text/html" , showEmptyMessageGFI : false } } ) ;
1046+ expect ( saved ) . toEqual ( {
1047+ map : {
1048+ center : { crs : 'EPSG:4326' , x : 0 , y : 0 } ,
1049+ groups : [ {
1050+ id : 'Default' ,
1051+ expanded : true
1052+ } , {
1053+ id : 'custom' ,
1054+ expanded : false
1055+ } , {
1056+ id : 'custom.nested001' ,
1057+ expanded : true
1058+ } ] ,
1059+ layers : [ {
1060+ allowedSRS : { } ,
1061+ thumbURL : undefined ,
1062+ availableStyles : undefined ,
1063+ bbox : { } ,
1064+ requestEncoding : undefined ,
1065+ capabilitiesURL : undefined ,
1066+ description : undefined ,
1067+ dimensions : [ ] ,
1068+ nativeCrs : undefined ,
1069+ features : undefined ,
1070+ queryable : undefined ,
1071+ featureInfo : undefined ,
1072+ format : undefined ,
1073+ group : undefined ,
1074+ hideLoading : false ,
1075+ handleClickOnLayer : false ,
1076+ id : "layer001" ,
1077+ matrixIds : [ 'EPSG:4326' ] ,
1078+ maxZoom : undefined ,
1079+ maxNativeZoom : undefined ,
1080+ name : "layer001" ,
1081+ opacity : undefined ,
1082+ params : { } ,
1083+ provider : undefined ,
1084+ search : { } ,
1085+ singleTile : false ,
1086+ source : undefined ,
1087+ style : undefined ,
1088+ styleName : undefined ,
1089+ styles : undefined ,
1090+ tileMatrixSet : true ,
1091+ tiled : undefined ,
1092+ title : "layer001" ,
1093+ transparent : undefined ,
1094+ type : "wms" ,
1095+ url : "http:url001" ,
1096+ visibility : true ,
1097+ catalogURL : "url" ,
1098+ hidden : false ,
1099+ useForElevation : false ,
1100+ origin : undefined ,
1101+ thematic : undefined ,
1102+ tooltipOptions : undefined ,
1103+ tooltipPlacement : undefined
1104+ } ] ,
1105+ mapOptions : { } ,
1106+ maxExtent : [ - 20037508.34 , - 20037508.34 , 20037508.34 , 20037508.34 ] ,
1107+ projection : 'EPSG:900913' ,
1108+ text_serch_config : '' ,
1109+ units : 'm' ,
1110+ zoom : 10 ,
1111+ sources : {
1112+ 'http:url001' : {
1113+ tileMatrixSet : {
1114+ 'EPSG:4326' : {
1115+ TileMatrix : [ {
1116+ 'ows:Identifier' : 'EPSG:4326:0'
1117+ } ] ,
1118+ 'ows:Identifier' : "EPSG:4326" ,
1119+ 'ows:SupportedCRS' : "urn:ogc:def:crs:EPSG::4326"
1120+ }
1121+ }
1122+ }
1123+ }
1124+ } ,
1125+ mapInfoConfiguration : {
1126+ infoFormat : "text/html" ,
1127+ showEmptyMessageGFI : false
1128+ } ,
1129+ version : 2
1130+ } ) ;
1131+ } ) ;
1132+
9721133 it ( 'test getIdFromUri ' , ( ) => {
9731134 // /mapstore2/rest/geostore/data/578/raw?decode=datauri
9741135 expect ( getIdFromUri ( '%2Fmapstore2%2Frest%2Fgeostore%2Fdata%2F578%2Fraw%3Fdecode%3Ddatauri' ) ) . toBe ( '578' ) ;
0 commit comments