Index: src/wmsplugin/WMSLayer.java =================================================================== --- src/wmsplugin/WMSLayer.java (revision 10666) +++ src/wmsplugin/WMSLayer.java (working copy) @@ -52,7 +52,7 @@ public int messageNum = 5; //limit for messages per layer protected boolean stopAfterPaint = false; - protected int ImageSize = 500; + protected int ImageSize = 1000; protected int dax = 10; protected int day = 10; protected int minZoom = 3; Index: src/wmsplugin/YAHOOGrabber.java =================================================================== --- src/wmsplugin/YAHOOGrabber.java (revision 10666) +++ src/wmsplugin/YAHOOGrabber.java (working copy) @@ -61,7 +61,7 @@ public void run() { Image img; - + width = (int) ((b.max.lon() - b.min.lon()) * pixelPerDegree); height = (int) ((b.max.lat() - b.min.lat()) * pixelPerDegree); @@ -80,7 +80,8 @@ } Process browser = browse(url.toString());; image.image = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB); - img = ImageIO.read(browser.getInputStream()).getScaledInstance(width, height, Image.SCALE_FAST); + img = grab(browser, width, height, + b.max.lat()); } image.image.getGraphics().drawImage(img, 0 , 0, null); @@ -102,7 +103,30 @@ } } + static protected Image grab(Process browser, int width, int height, + double lat) throws IOException { + BufferedImage img; + double ratio; + /* + * Calculate the pixel aspect ratio: + * 1 deg lon in meters / 1 deg lat in meters. + * (should multiply by 40075.02 / 40007.86 - equatorial + * to meridional circumference, but don't know if Yahoo! + * takes that into account) + */ + ratio = Math.cos(Math.toRadians(lat)); + /* + * gnome-web-photo + gecko gives us an image with height + * matching the picture's height and width of some broswer + * default value, with the image aligned to left. + */ + img = ImageIO.read(browser.getInputStream()); + width = (int) + (img.getWidth() * width / ratio / img.getHeight()) + 1; + return img.getScaledInstance(width, height, Image.SCALE_SMOOTH); + } + protected Process browse(String url) throws IOException { ArrayList cmdParams = new ArrayList(); Index: resources/ymap.html =================================================================== --- resources/ymap.html (revision 10666) +++ resources/ymap.html (working copy) @@ -1,10 +1,6 @@ - +