Changeset 18948 in josm
- Timestamp:
- 2024-01-21T08:34:04+01:00 (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r18927 r18948 101 101 102 102 private final ListenerList<IGeoImageLayer.ImageChangeListener> imageChangeListenerListenerList = ListenerList.create(); 103 private MarkerMouseAdapter mouseAdapter; 104 private MapView mapView; 103 105 104 106 /** … … 193 195 data.forEach(Marker::destroy); 194 196 data.clear(); 197 if (mouseAdapter != null && mapView != null) 198 mapView.removeMouseListener(mouseAdapter); 195 199 super.destroy(); 196 200 } … … 198 202 @Override 199 203 public LayerPainter attachToMapView(MapViewEvent event) { 200 event.getMapView().addMouseListener(new MarkerMouseAdapter()); 204 if (mapView != null) { 205 Logging.warn("MarkerLayer was already attached to a MapView"); 206 } 207 mapView = event.getMapView(); 208 mouseAdapter = new MarkerMouseAdapter(); 209 mapView.addMouseListener(mouseAdapter); 201 210 202 211 if (event.getMapView().playHeadMarker == null) {
Note:
See TracChangeset
for help on using the changeset viewer.