Changeset 13645 in osm for applications/editors/josm/plugins/wmsplugin/src/wmsplugin/YAHOOGrabber.java
- Timestamp:
- 2009-02-10T17:42:52+01:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/wmsplugin/src/wmsplugin/YAHOOGrabber.java
r13497 r13645 21 21 public class YAHOOGrabber extends WMSGrabber{ 22 22 protected String browserCmd; 23 protected Cache cache = new wmsplugin.Cache(); 23 24 24 25 YAHOOGrabber(String baseURL, Bounds b, Projection proj, 25 26 double pixelPerDegree, GeorefImage image, MapView mv, WMSLayer layer) { 26 super("file:///" + Main.pref.getPreferencesDir() + "plugins/wmsplugin/ymap.html?" 27 // + "request=getmap&format=image/jpeg" 27 super("file:///" + WMSPlugin.getPrefsPath() + "ymap.html?" 28 28 , b, proj, pixelPerDegree, image, mv, layer); 29 29 this.browserCmd = baseURL.replaceFirst("yahoo://", ""); … … 31 31 32 32 protected BufferedImage grab(URL url) throws IOException { 33 ArrayList<String> cmdParams = new ArrayList<String>();34 33 String urlstring = url.toExternalForm(); 35 34 // work around a problem in URL removing 2 slashes 36 35 if(!urlstring.startsWith("file:///")) 37 36 urlstring = urlstring.replaceFirst("file:", "file://"); 37 38 BufferedImage cached = cache.getImg(urlstring); 39 if(cached != null) return cached; 40 41 ArrayList<String> cmdParams = new ArrayList<String>(); 38 42 StringTokenizer st = new StringTokenizer(MessageFormat.format(browserCmd, urlstring)); 39 43 while( st.hasMoreTokens() ) … … 50 54 } 51 55 52 return ImageIO.read(browser.getInputStream());56 return cache.saveImg(urlstring, ImageIO.read(browser.getInputStream()), true); 53 57 } 54 58 }
Note:
See TracChangeset
for help on using the changeset viewer.