Changeset 19870

Show
Ignore:
Timestamp:
02/04/10 20:45:27 (2 years ago)
Author:
bastik
Message:

minor extension (patch by svenmeier)

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/viewer/jmapviewer/src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

    r19697 r19870  
    494494        if (mapMarkersVisible && mapMarkerList != null) { 
    495495            for (MapMarker marker : mapMarkerList) { 
    496                 Point p = getMapPosition(marker.getLat(), marker.getLon()); 
    497                 if (p != null) { 
    498                     marker.paint(g, p); 
    499                 } 
     496                paintMarker(g, marker); 
    500497            } 
    501498        } 
    502499    } 
    503500 
     501    /** 
     502     * Paint a single marker. 
     503     */ 
     504    protected void paintMarker(Graphics g, MapMarker marker) { 
     505        Point p = getMapPosition(marker.getLat(), marker.getLon()); 
     506        if (p != null) { 
     507            marker.paint(g, p); 
     508        } 
     509    } 
     510     
    504511    /** 
    505512     * Moves the visible map pane. 
     
    626633    public void addMapMarker(MapMarker marker) { 
    627634        mapMarkerList.add(marker); 
     635        repaint(); 
     636    } 
     637 
     638    public void removeMapMarker(MapMarker marker) { 
     639        mapMarkerList.remove(marker); 
    628640        repaint(); 
    629641    }