source: josm/trunk/src/org/openstreetmap/josm/data/imagery/WMSCachedTileLoaderJob.java@ 13388

Last change on this file since 13388 was 11858, checked in by bastiK, 7 years ago

fixed #7427 - Support reprojection (warping) of imagery layer

  • Property svn:eol-style set to native
File size: 1.7 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.data.imagery;
3
4import java.util.Map;
5import java.util.concurrent.ThreadPoolExecutor;
6
7import org.apache.commons.jcs.access.behavior.ICacheAccess;
8import org.openstreetmap.gui.jmapviewer.Tile;
9import org.openstreetmap.gui.jmapviewer.interfaces.TileLoaderListener;
10import org.openstreetmap.josm.data.cache.BufferedImageCacheEntry;
11
12/**
13 * Separate class to handle WMS jobs, as it needs to react differently to HTTP response codes from WMS server
14 *
15 * @author Wiktor Niesiobędzki
16 * @since 8526
17 */
18public class WMSCachedTileLoaderJob extends TMSCachedTileLoaderJob {
19
20 /**
21 * Creates a job - that will download specific tile
22 * @param listener will be notified, when tile has loaded
23 * @param tile to load
24 * @param cache to use (get/put)
25 * @param connectTimeout to tile source
26 * @param readTimeout to tile source
27 * @param headers to be sent with request
28 * @param downloadExecutor that will execute the download task (if needed)
29 */
30 public WMSCachedTileLoaderJob(TileLoaderListener listener, Tile tile,
31 ICacheAccess<String, BufferedImageCacheEntry> cache, int connectTimeout, int readTimeout,
32 Map<String, String> headers, ThreadPoolExecutor downloadExecutor) {
33 super(listener, tile, cache, connectTimeout, readTimeout, headers, downloadExecutor);
34 }
35
36 @Override
37 public String getCacheKey() {
38 // include projection in cache key, as with different projections different response will be returned from server
39 String key = super.getCacheKey();
40 if (key != null) {
41 return key + tile.getSource().getServerCRS();
42 }
43 return null;
44 }
45}
Note: See TracBrowser for help on using the repository browser.