File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed
Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change @@ -1021,4 +1021,37 @@ describe('GeoJSON', () => {
10211021 expect ( outObj . length ) . toBe ( 1917.06710696352 ) ;
10221022 expect ( outObj . minM ) . toBe ( 0 ) ;
10231023 } ) ;
1024+ it ( 'TEXT' , ( ) => {
1025+ const obj = {
1026+ fid :1234 ,
1027+ geometry :{
1028+ "texts" : [ "北京" ] ,
1029+ "center" : {
1030+ "x" : 116.22391121440256 ,
1031+ "y" : 39.95012680584955
1032+ } ,
1033+ "parts" : null ,
1034+ "style" : null ,
1035+ "prjCoordSys" : null ,
1036+ "textStyle" : {
1037+ "fontHeight" : 3.7 ,
1038+ } ,
1039+ "id" : 2 ,
1040+ "type" : "TEXT" ,
1041+ "rotations" : [ - 2.7 ] ,
1042+ "partTopo" : null ,
1043+ "points" : [ {
1044+ "x" : 116.22391121440256 ,
1045+ "y" : 39.95012680584955
1046+ } ]
1047+ }
1048+
1049+ } ;
1050+ const outObj = new GeoJSON ( ) . toGeoJSON ( obj ) ;
1051+ expect ( outObj ) . not . toBeNull ( ) ;
1052+ expect ( outObj . id ) . toBe ( 1234 ) ;
1053+ expect ( outObj . properties . textStyle . fontHeight ) . toBe ( 3.7 ) ;
1054+ expect ( outObj . properties . texts . length ) . toBe ( 1 ) ;
1055+ expect ( outObj . properties . texts [ 0 ] ) . toBe ( "北京" ) ;
1056+ } ) ;
10241057} ) ;
You can’t perform that action at this time.
0 commit comments