Changes between Initial Version and Version 1 of Ticket #23408, comment 11


Ignore:
Timestamp:
2024-01-11T17:57:09+01:00 (2 years ago)
Author:
GerdP

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23408, comment 11

    initial v1  
    33When I close all the image layers a lot of `addMouseMotionListener()` actions are triggered from `GeoImageLayer.mapModeListener`
    44This is probably not intended?
     5This code in never seems to remove listeners. No idea how it should look like.
     6{{{
     7#!java
     8        mapModeListener = (oldMapMode, newMapMode) -> {
     9            MapView mapView = MainApplication.getMap().mapView;
     10            if (newMapMode == null || isSupportedMapMode(newMapMode)) {
     11                mapView.addMouseListener(mouseAdapter);
     12                mapView.addMouseMotionListener(mouseMotionAdapter);
     13            } else {
     14                mapView.removeMouseListener(mouseAdapter);
     15                mapView.removeMouseMotionListener(mouseMotionAdapter);
     16            }
     17        };
     18}}}