@@ -10,28 +10,32 @@ void main() {
1010 distance (Point (coordinates: via), Point (coordinates: end), Unit .meters);
1111 expect (viaToEndDistance.round (), equals (198 ));
1212 final resolvedViaPoint = along (line, - 1 * viaToEndDistance, Unit .meters);
13- expect (resolvedViaPoint.coordinates, equals (via));
13+ expect (resolvedViaPoint.geometry, isNotNull);
14+ expect (resolvedViaPoint.geometry! .coordinates, equals (via));
1415 });
1516 test ('along - to start point' , () {
1617 final resolvedStartPoint = along (line, 0 , Unit .meters);
17- expect (resolvedStartPoint.coordinates, equals (start));
18+ expect (resolvedStartPoint.geometry, isNotNull);
19+ expect (resolvedStartPoint.geometry! .coordinates, equals (start));
1820 });
1921 test ('along - to point between start and via' , () {
2022 final startToViaDistance = distance (
2123 Point (coordinates: start), Point (coordinates: via), Unit .meters);
2224 expect (startToViaDistance.round (), equals (57 ));
2325 final resolvedViaPoint = along (line, startToViaDistance / 2 , Unit .meters);
24- expect (resolvedViaPoint.coordinates.lat.toStringAsFixed (6 ),
26+ expect (resolvedViaPoint.geometry, isNotNull);
27+ expect (resolvedViaPoint.geometry! .coordinates.lat.toStringAsFixed (6 ),
2528 equals ('55.709028' ));
26- expect (resolvedViaPoint.coordinates.lng.toStringAsFixed (6 ),
29+ expect (resolvedViaPoint.geometry ! . coordinates.lng.toStringAsFixed (6 ),
2730 equals ('13.185096' ));
2831 });
2932 test ('along - to via point' , () {
3033 final startToViaDistance = distance (
3134 Point (coordinates: start), Point (coordinates: via), Unit .meters);
3235 expect (startToViaDistance.round (), equals (57 ));
3336 final resolvedViaPoint = along (line, startToViaDistance, Unit .meters);
34- expect (resolvedViaPoint.coordinates, equals (via));
37+ expect (resolvedViaPoint.geometry, isNotNull);
38+ expect (resolvedViaPoint.geometry! .coordinates, equals (via));
3539 });
3640 test ('along - to point between via and end' , () {
3741 final startToViaDistance = distance (
@@ -42,28 +46,32 @@ void main() {
4246 expect (viaToEndDistance.round (), equals (198 ));
4347 final resolvedViaPoint =
4448 along (line, startToViaDistance + viaToEndDistance / 2 , Unit .meters);
45- expect (resolvedViaPoint.coordinates.lat.toStringAsFixed (6 ),
49+ expect (resolvedViaPoint.geometry, isNotNull);
50+ expect (resolvedViaPoint.geometry! .coordinates.lat.toStringAsFixed (6 ),
4651 equals ('55.708330' ));
47- expect (resolvedViaPoint.coordinates.lng.toStringAsFixed (6 ),
52+ expect (resolvedViaPoint.geometry ! . coordinates.lng.toStringAsFixed (6 ),
4853 equals ('13.186555' ));
4954 });
5055 test ('along - to end point' , () {
5156 final len = length (line, Unit .meters);
5257 expect (len.round (), equals (254 ));
5358 final resolvedEndPoint = along (line, len, Unit .meters);
54- expect (resolvedEndPoint.coordinates, equals (end));
59+ expect (resolvedEndPoint.geometry, isNotNull);
60+ expect (resolvedEndPoint.geometry! .coordinates, equals (end));
5561 });
5662 test ('along - to end point - default unit (km)' , () {
5763 final len = length (line);
5864 expect ((len * 1000 ).round (), equals (254 ));
5965 final resolvedEndPoint = along (line, len);
60- expect (resolvedEndPoint.coordinates, equals (end));
66+ expect (resolvedEndPoint.geometry, isNotNull);
67+ expect (resolvedEndPoint.geometry! .coordinates, equals (end));
6168 });
6269 test ('along - beyond end point' , () {
6370 final len = length (line, Unit .meters);
6471 expect (len.round (), equals (254 ));
6572 final resolvedEndPoint = along (line, len + 100 , Unit .meters);
66- expect (resolvedEndPoint.coordinates, equals (end));
73+ expect (resolvedEndPoint.geometry, isNotNull);
74+ expect (resolvedEndPoint.geometry! .coordinates, equals (end));
6775 });
6876}
6977
0 commit comments