Ticket #4480: jmapviewer.patch

File jmapviewer.patch, 1.3 KB (added by svenmeier, 2 years ago)

patch adding two new methods

  • src/org/openstreetmap/gui/jmapviewer/JMapViewer.java

     
    493493 
    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 
    504501    /** 
     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     
     511    /** 
    505512     * Moves the visible map pane. 
    506513     *  
    507514     * @param x 
     
    628635        repaint(); 
    629636    } 
    630637 
     638    public void removeMapMarker(MapMarker marker) { 
     639        mapMarkerList.remove(marker); 
     640        repaint(); 
     641    } 
     642 
    631643    public void addMapRectangle(MapRectangle rectangle) { 
    632644        mapRectangleList.add(rectangle); 
    633645        repaint();