@@ -533,12 +533,12 @@ describe('mapbox plots', function() {
533
533
. then ( done , done . fail ) ;
534
534
} , LONG_TIMEOUT_INTERVAL ) ;
535
535
536
+ // TODO: mockWithLayers.layout.mapbox.layers array only has 1 entry
536
537
xit ( '@gl should be able to add, update and remove layers' , function ( done ) {
537
538
var mockWithLayers = require ( '../../image/mocks/mapbox_layers' ) ;
538
539
539
540
var layer0 = Lib . extendDeep ( { } , mockWithLayers . layout . mapbox . layers [ 0 ] ) ;
540
541
541
- // mockWithLayers.layout.mapbox.layers array only has 1 entry
542
542
var layer1 = Lib . extendDeep ( { } , mockWithLayers . layout . mapbox . layers [ 1 ] ) ;
543
543
544
544
var mapUpdate = {
@@ -1123,7 +1123,7 @@ describe('mapbox plots', function() {
1123
1123
} )
1124
1124
. then ( function ( ) {
1125
1125
expect ( relayoutCnt ) . toBe ( 3 , 'relayout cnt' ) ;
1126
- expect ( relayoutingCnt ) . toBeCloseTo ( 10 , - 1 , 'relayouting cnt' ) ;
1126
+ expect ( relayoutingCnt ) . toBeCloseTo ( 21 , - 1 , 'relayouting cnt' ) ;
1127
1127
expect ( doubleClickCnt ) . toBe ( 1 , 'double click cnt' ) ;
1128
1128
expect ( getMapInfo ( gd ) . zoom ) . toBeGreaterThan ( 1.234 ) ;
1129
1129
} )
@@ -1579,80 +1579,85 @@ describe('test mapbox trace/layout *below* interactions', function() {
1579
1579
mapbox : {
1580
1580
style : 'basic' ,
1581
1581
layers : [ {
1582
- sourcetype : 'vector' ,
1583
- source : 'insert-terrain-source' ,
1584
- sourcelayer : 'contour' ,
1585
- type : 'line'
1582
+ "source" : {
1583
+ "name" : "LIMADMIN" ,
1584
+ "type" : "FeatureCollection" ,
1585
+ "features" : [ ]
1586
+ } ,
1587
+ "type" : "fill" ,
1588
+ "below" : "water" ,
1589
+ "color" : "#ece2f0" ,
1590
+ "opacity" : 0.8
1586
1591
} ]
1587
1592
}
1588
1593
} )
1589
1594
. then ( function ( ) {
1590
1595
_assert ( 'default *below*' , {
1591
- trace : [ 20 , 21 , 22 , 23 ] ,
1592
- layout : 24
1596
+ trace : [ 94 , 95 , 96 , 97 ] ,
1597
+ layout : 9
1593
1598
} ) ;
1594
1599
} )
1595
1600
. then ( function ( ) { return Plotly . relayout ( gd , 'mapbox.layers[0].below' , 'traces' ) ; } )
1596
1601
. then ( function ( ) {
1597
1602
_assert ( 'with layout layer *below:traces*' , {
1598
- trace : [ 21 , 22 , 23 , 24 ] ,
1599
- layout : 20
1603
+ trace : [ 94 , 95 , 96 , 97 ] ,
1604
+ layout : 93
1600
1605
} ) ;
1601
1606
} )
1602
1607
. then ( function ( ) { return Plotly . relayout ( gd , 'mapbox.layers[0].below' , null ) ; } )
1603
1608
. then ( function ( ) {
1604
1609
_assert ( 'back to default *below* (1)' , {
1605
- trace : [ 20 , 21 , 22 , 23 ] ,
1606
- layout : 24
1610
+ trace : [ 93 , 94 , 95 , 96 ] ,
1611
+ layout : 97
1607
1612
} ) ;
1608
1613
} )
1609
1614
. then ( function ( ) { return Plotly . restyle ( gd , 'below' , '' ) ; } )
1610
1615
. then ( function ( ) {
1611
1616
_assert ( 'with trace *below:""*' , {
1612
- trace : [ 21 , 22 , 23 , 24 ] ,
1613
- layout : 20
1617
+ trace : [ 94 , 95 , 96 , 97 ] ,
1618
+ layout : 93
1614
1619
} ) ;
1615
1620
} )
1616
1621
. then ( function ( ) { return Plotly . restyle ( gd , 'below' , null ) ; } )
1617
1622
. then ( function ( ) {
1618
1623
_assert ( 'back to default *below* (2)' , {
1619
- trace : [ 20 , 21 , 22 , 23 ] ,
1620
- layout : 24
1624
+ trace : [ 93 , 94 , 95 , 96 ] ,
1625
+ layout : 97
1621
1626
} ) ;
1622
1627
} )
1623
1628
. then ( function ( ) { return Plotly . restyle ( gd , 'below' , 'water' ) ; } )
1624
1629
. then ( function ( ) {
1625
1630
_assert ( 'with trace *below:water*' , {
1626
- trace : [ 4 , 5 , 6 , 7 ] ,
1627
- layout : 24
1631
+ trace : [ 9 , 10 , 11 , 12 ] ,
1632
+ layout : 97
1628
1633
} ) ;
1629
1634
} )
1630
1635
. then ( function ( ) { return Plotly . relayout ( gd , 'mapbox.layers[0].below' , 'water' ) ; } )
1631
1636
. then ( function ( ) {
1632
1637
_assert ( 'with trace AND layout layer *below:water*' , {
1633
- trace : [ 4 , 5 , 6 , 7 ] ,
1634
- layout : 8
1638
+ trace : [ 9 , 10 , 11 , 12 ] ,
1639
+ layout : 13
1635
1640
} ) ;
1636
1641
} )
1637
1642
. then ( function ( ) { return Plotly . relayout ( gd , 'mapbox.layers[0].below' , '' ) ; } )
1638
1643
. then ( function ( ) {
1639
1644
_assert ( 'with trace *below:water* and layout layer *below:""*' , {
1640
- trace : [ 4 , 5 , 6 , 7 ] ,
1641
- layout : 24
1645
+ trace : [ 9 , 10 , 11 , 12 ] ,
1646
+ layout : 97
1642
1647
} ) ;
1643
1648
} )
1644
1649
. then ( function ( ) { return Plotly . restyle ( gd , 'below' , '' ) ; } )
1645
1650
. then ( function ( ) {
1646
1651
_assert ( 'with trace AND layout layer *below:water*' , {
1647
- trace : [ 20 , 21 , 22 , 23 ] ,
1648
- layout : 24
1652
+ trace : [ 93 , 94 , 95 , 96 ] ,
1653
+ layout : 97
1649
1654
} ) ;
1650
1655
} )
1651
1656
. then ( function ( ) { return Plotly . update ( gd , { below : null } , { 'mapbox.layers[0].below' : null } ) ; } )
1652
1657
. then ( function ( ) {
1653
1658
_assert ( 'back to default *below* (3)' , {
1654
- trace : [ 20 , 21 , 22 , 23 ] ,
1655
- layout : 24
1659
+ trace : [ 93 , 94 , 95 , 96 ] ,
1660
+ layout : 97
1656
1661
} ) ;
1657
1662
} )
1658
1663
. then ( done , done . fail ) ;
0 commit comments