@@ -51,8 +51,8 @@ export default class EventHandler {
5151 * WARNING: This method doesn't call model.save_changes()!
5252 */
5353 updateRotation ( ) {
54- if ( ! this . isLastDiv ( ) ) return ;
55- this . model . set ( "_rotation" , this . aladin . getRotation ( ) ) ;
54+ let rotation = this . model . get ( "_rotation" ) ;
55+ this . aladin . setRotation ( rotation ) ;
5656 }
5757
5858 /**
@@ -144,6 +144,7 @@ export default class EventHandler {
144144 // Update WCS and FoV only if this is the last div
145145 this . updateWCS ( ) ;
146146 this . update2AxisFoV ( ) ;
147+ if ( ! this . isLastDiv ( ) ) return ;
147148 this . model . save_changes ( ) ;
148149 } ) ;
149150
@@ -203,14 +204,9 @@ export default class EventHandler {
203204 } ) ;
204205
205206 this . aladin . on ( "rotationChanged" , ( object ) => {
206- if ( object [ "data" ] !== undefined ) {
207- this . model . send ( {
208- event_type : "rotation_changed" ,
209- content : {
210- rotation : object [ "rotation" ] ,
211- } ,
212- } ) ;
213- }
207+ this . updateRotation ( ) ;
208+ if ( ! this . isLastDiv ( ) ) return ;
209+ this . model . save_changes ( ) ;
214210 } ) ;
215211
216212 this . aladin . on ( "objectClicked" , ( clicked ) => {
@@ -302,7 +298,6 @@ export default class EventHandler {
302298 this . eventHandlers = {
303299 add_marker : this . messageHandler . handleAddMarker ,
304300 change_fov : this . messageHandler . handleChangeFoV ,
305- change_rotation : this . messageHandler . handleChangeRotation ,
306301 goto_ra_dec : this . messageHandler . handleGotoRaDec ,
307302 save_view_as_image : this . messageHandler . handleSaveViewAsImage ,
308303 add_fits : this . messageHandler . handleAddFits ,
0 commit comments