Changeset 4624 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2011-12-01T13:20:18+01:00 (13 years ago)
Author:
Don-vip
Message:

see #6987 - multipolygon cache aware of projection change

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/relations/MultipolygonCache.java

    r4623 r4624  
    77import java.util.Map;
    88
     9import org.openstreetmap.josm.Main;
    910import org.openstreetmap.josm.data.osm.DataSet;
    1011import org.openstreetmap.josm.data.osm.Node;
     
    2122import org.openstreetmap.josm.data.osm.event.TagsChangedEvent;
    2223import org.openstreetmap.josm.data.osm.event.WayNodesChangedEvent;
     24import org.openstreetmap.josm.data.projection.Projection;
     25import org.openstreetmap.josm.data.projection.ProjectionChangeListener;
    2326import org.openstreetmap.josm.gui.MapView.LayerChangeListener;
    2427import org.openstreetmap.josm.gui.NavigatableComponent;
     
    3134 *
    3235 */
    33 public class MultipolygonCache implements DataSetListener, LayerChangeListener, ZoomChangeListener {
     36public class MultipolygonCache implements DataSetListener, LayerChangeListener, ZoomChangeListener, ProjectionChangeListener {
    3437
    3538    private static final MultipolygonCache instance = new MultipolygonCache();
     
    3942    private MultipolygonCache() {
    4043        this.cache = new HashMap<NavigatableComponent, Map<DataSet, Map<Relation,Multipolygon>>>();
     44        Main.addProjectionChangeListener(this);
    4145    }
    4246
     
    206210        clear();
    207211    }
     212
     213    @Override
     214    public void projectionChanged(Projection oldValue, Projection newValue) {
     215        clear();
     216    }
    208217}
Note: See TracChangeset for help on using the changeset viewer.