Index: /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java
===================================================================
--- /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 5476)
+++ /trunk/src/org/openstreetmap/josm/actions/GpxExportAction.java	(revision 5477)
@@ -34,10 +34,13 @@
     }
 
-    protected GpxLayer getLayer() {
-        if (!Main.isDisplayingMapView()) return null;
-        if (Main.map.mapView.getActiveLayer() == null) return null;
+    /**
+     * Get the layer to export.
+     * @return The layer to export, either a {@link GpxLayer} or {@link OsmDataLayer}.
+     */
+    protected Layer getLayer() {
+        if(!Main.isDisplayingMapView())
+            return null;
         Layer layer = Main.map.mapView.getActiveLayer();
-        if (! (layer instanceof GpxLayer)) return null;
-        return (GpxLayer)layer;
+        return (layer instanceof GpxLayer || layer instanceof OsmDataLayer) ? layer : null;
     }
 
@@ -45,5 +48,5 @@
         if (!isEnabled())
             return;
-        GpxLayer layer = getLayer();
+        Layer layer = getLayer();
         if (layer == null) {
             JOptionPane.showMessageDialog(
@@ -95,13 +98,5 @@
     @Override
     protected void updateEnabledState() {
-        boolean check =
-        Main.isDisplayingMapView()
-        && Main.map.mapView.getActiveLayer() != null;
-        if(!check) {
-            setEnabled(false);
-            return;
-        }
-        Layer layer = Main.map.mapView.getActiveLayer();
-        setEnabled(layer instanceof GpxLayer);
+        setEnabled(getLayer() != null);
     }
 }
