Changeset 8636 in josm


Ignore:
Timestamp:
2015-08-02T12:14:18+02:00 (9 years ago)
Author:
wiktorn
Message:

Small TMS fixes.

  • fix handling of minimum and maximum expiration times (tiles were usually set for expiration at 1 month instead what headers returned)
  • fix right-click menu command "Load tile" not reloading the tiles
  • fix null pointer dereference reported by Coverity
Location:
trunk/src/org/openstreetmap/josm
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/imagery/TMSCachedTileLoaderJob.java

    r8635 r8636  
    252252        // keep the expiration time between MINIMUM_EXPIRES and MAXIMUM_EXPIRES, so we will cache the tiles
    253253        // at least for some short period of time, but not too long
    254         if (ret.getExpirationTime() < MINIMUM_EXPIRES) {
     254        if (ret.getExpirationTime() < now + MINIMUM_EXPIRES) {
    255255            ret.setExpirationTime(now + MINIMUM_EXPIRES);
    256256        }
    257         if (ret.getExpirationTime() > MAXIMUM_EXPIRES) {
     257        if (ret.getExpirationTime() > now + MAXIMUM_EXPIRES) {
    258258            ret.setExpirationTime(now + MAXIMUM_EXPIRES);
    259259        }
  • trunk/src/org/openstreetmap/josm/gui/layer/AbstractTileSourceLayer.java

    r8625 r8636  
    497497    public void hookUpMapView() {
    498498        this.tileSource = getTileSource(info);
     499        if (this.tileSource == null) {
     500            throw new IllegalArgumentException(tr("Failed to create tile source"));
     501        }
     502
    499503        projectionChanged(null, Main.getProjection()); // check if projection is supported
    500504        initTileSource(this.tileSource);
     
    858862        if (tile.isLoading())
    859863            return false;
    860         tileLoader.createTileLoaderJob(tile).submit();
     864        tileLoader.createTileLoaderJob(tile).submit(force);
    861865        return true;
    862866    }
Note: See TracChangeset for help on using the changeset viewer.