@@ -1465,4 +1465,46 @@ describe('Draw & Edit Poly', () => {
1465
1465
expect ( layer . getLatLngs ( ) [ 0 ] [ 0 ] . lng ) . to . eq ( - 0.15037536621093753 ) ;
1466
1466
} ) ;
1467
1467
} ) ;
1468
+
1469
+ it ( 'keeps alt coordinate after editing a vertex' , ( ) => {
1470
+ let polygon ;
1471
+
1472
+ cy . window ( ) . then ( ( { map, L } ) => {
1473
+ polygon = L . polygon ( [
1474
+ [
1475
+ [ 20.53507732696281 , 71.98242187500001 , 111 ] ,
1476
+ [ 19.87005983797396 , 71.97143554687501 , 222 ] ,
1477
+ [ 19.782211275967995 , 73.35021972656251 , 333 ] ,
1478
+ [ 20.55565240377338 , 73.48754882812501 , 444 ] ,
1479
+ [ 20.53507732696281 , 71.98242187500001 , 111 ] ,
1480
+ ] ,
1481
+ ] ) ;
1482
+ polygon . addTo ( map ) ;
1483
+ map . fitBounds ( polygon . getBounds ( ) , { animate : false } ) ;
1484
+
1485
+ expect (
1486
+ polygon
1487
+ . getLatLngs ( )
1488
+ . flat ( )
1489
+ . map ( ( a ) => a . alt )
1490
+ . join ( ',' )
1491
+ ) . to . equal ( '111,222,333,444' ) ;
1492
+ } ) ;
1493
+
1494
+ cy . toolbarButton ( 'edit' ) . click ( ) ;
1495
+
1496
+ cy . get ( mapSelector ) . trigger ( 'mousedown' , 225 , 105 , { which : 1 } ) ;
1497
+ cy . get ( mapSelector ) . trigger ( 'mousemove' , 225 , 150 , { which : 1 } ) ;
1498
+ cy . get ( mapSelector ) . trigger ( 'mouseup' , 225 , 150 , { which : 1 } ) ;
1499
+
1500
+ cy . window ( ) . then ( ( ) => {
1501
+ expect (
1502
+ polygon
1503
+ . getLatLngs ( )
1504
+ . flat ( )
1505
+ . map ( ( a ) => a . alt )
1506
+ . join ( ',' )
1507
+ ) . to . equal ( '111,222,333,444' ) ;
1508
+ } ) ;
1509
+ } ) ;
1468
1510
} ) ;
0 commit comments