Skip to content

Commit 11e865b

Browse files
committed
【fix】UT
1 parent 1cb35f4 commit 11e865b

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed

test/common/format/GeoJSONSpec.js

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff 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
});

0 commit comments

Comments
 (0)