@@ -461,7 +461,7 @@ proto.initFx = function(calcData, fullLayout) {
461
461
optsNow . _input . bearing = optsNow . bearing = viewNow . bearing ;
462
462
optsNow . _input . pitch = optsNow . pitch = viewNow . pitch ;
463
463
464
- gd . emit ( 'plotly_relayout' , self . getViewEdits ( viewNow , true ) ) ;
464
+ gd . emit ( 'plotly_relayout' , self . getViewEditsWithDerived ( viewNow ) ) ;
465
465
}
466
466
wheeling = false ;
467
467
@@ -509,7 +509,7 @@ proto.initFx = function(calcData, fullLayout) {
509
509
510
510
function emitUpdate ( ) {
511
511
var viewNow = self . getView ( ) ;
512
- gd . emit ( 'plotly_relayouting' , self . getViewEdits ( viewNow , true ) ) ;
512
+ gd . emit ( 'plotly_relayouting' , self . getViewEditsWithDerived ( viewNow ) ) ;
513
513
}
514
514
515
515
map . on ( 'drag' , emitUpdate ) ;
@@ -532,7 +532,7 @@ proto.initFx = function(calcData, fullLayout) {
532
532
optsNow . _input . pitch = optsNow . pitch = viewNow . pitch ;
533
533
534
534
gd . emit ( 'plotly_doubleclick' , null ) ;
535
- gd . emit ( 'plotly_relayout' , self . getViewEdits ( viewNow , true ) ) ;
535
+ gd . emit ( 'plotly_relayout' , self . getViewEditsWithDerived ( viewNow ) ) ;
536
536
} ) ;
537
537
538
538
// define event handlers on map creation, to keep one ref per map,
@@ -771,12 +771,9 @@ proto.getView = function() {
771
771
} ;
772
772
} ;
773
773
774
- proto . getViewEdits = function ( cont , derived ) {
774
+ proto . getViewEdits = function ( cont ) {
775
775
var id = this . id ;
776
776
var keys = [ 'center' , 'zoom' , 'bearing' , 'pitch' ] ;
777
- if ( derived === true ) {
778
- keys . push ( '_derived' ) ;
779
- }
780
777
var obj = { } ;
781
778
782
779
for ( var i = 0 ; i < keys . length ; i ++ ) {
@@ -787,6 +784,13 @@ proto.getViewEdits = function(cont, derived) {
787
784
return obj ;
788
785
} ;
789
786
787
+ proto . getViewEditsWithDerived = function ( cont ) {
788
+ var id = this . id ;
789
+ var obj = this . getViewEdits ( cont ) ;
790
+ obj [ id + '._derived' ] = cont . _derived ;
791
+ return obj ;
792
+ } ;
793
+
790
794
function getStyleObj ( val ) {
791
795
var styleObj = { } ;
792
796
0 commit comments