This is an automated email from the git hooks/post-receive script. fnatter-guest pushed a commit to branch master in repository jmapviewer.
commit 83a031f7d1bc6c881928a5f1a5d979396f814354 Author: Felix Natter <fnat...@gmx.net> Date: Tue Oct 21 17:45:24 2014 +0200 1.03+dfsg-2: add patch to download Bing logo at runtime --- debian/changelog | 9 ++++++ debian/patches/04-bing-logo.patch | 59 +++++++++++++++++++++++++++++++++++++++ debian/patches/series | 1 + 3 files changed, 69 insertions(+) diff --git a/debian/changelog b/debian/changelog index 01db403..3d9de00 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +jmapviewer (1.03+dfsg-2) unstable; urgency=medium + + * Download the bing logo at runtime from the link in the + attribution XML (thanks to Marcus Lundblad <m...@update.uu.se> and + Martin Krüger <martin.krue...@gmx.com>) + * Closes: #765421 + + -- Felix Natter <fnat...@gmx.net> Tue, 21 Oct 2014 17:39:41 +0200 + jmapviewer (1.03+dfsg-1) unstable; urgency=medium * New upstream version diff --git a/debian/patches/04-bing-logo.patch b/debian/patches/04-bing-logo.patch new file mode 100644 index 0000000..87a8c01 --- /dev/null +++ b/debian/patches/04-bing-logo.patch @@ -0,0 +1,59 @@ +Description: Download the Bing logo when it's not installed. + The Bing logo is required for attribution when using the imagery, but the + license terms covering the image are unclear. JMapViewer is licesed under + the GPL, but the Bing logo is mostly likely not. + . + To not require the inclusion of the bing_maps.png file in the jmapviewer + package, the image is downloaded using the URL provided in the BrandLogoUri + attribute of the attribution response. + . +Author: Marcus Lundblad <m...@update.uu.se> & Martin Krüger <martin.krue...@gmx.com> +Bug-Debian: https://bugs.debian.org/765421 + +--- a/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java ++++ b/src/org/openstreetmap/gui/jmapviewer/tilesources/BingAerialTileSource.java +@@ -3,6 +3,7 @@ package org.openstreetmap.gui.jmapviewer + + import java.awt.Image; + import java.io.IOException; ++import java.io.InputStream; + import java.net.MalformedURLException; + import java.net.URL; + import java.util.ArrayList; +@@ -45,6 +46,7 @@ public class BingAerialTileSource extend + private static final Pattern subdomainPattern = Pattern.compile("\\{subdomain\\}"); + private static final Pattern quadkeyPattern = Pattern.compile("\\{quadkey\\}"); + private static final Pattern culturePattern = Pattern.compile("\\{culture\\}"); ++ private String BrandLogoUri = null; + + public BingAerialTileSource() { + super("Bing Aerial Maps", "http://example.com/"); +@@ -97,6 +99,9 @@ public class BingAerialTileSource extend + subdomains[i] = subdomainTxt.item(i).getNodeValue(); + } + ++ XPathExpression BrandLogoUriXpath = xpath.compile("/Response/BrandLogoUri/text()"); ++ this.BrandLogoUri = BrandLogoUriXpath.evaluate(document); ++ + XPathExpression attributionXpath = xpath.compile("Attribution/text()"); + XPathExpression coverageAreaXpath = xpath.compile("CoverageArea"); + XPathExpression zoomMinXpath = xpath.compile("ZoomMin/text()"); +@@ -173,8 +178,17 @@ public class BingAerialTileSource extend + + @Override + public Image getAttributionImage() { ++ for( int i=0 ; i<5 && getAttribution()==null ; i++ ) ; + try { +- return ImageIO.read(JMapViewer.class.getResourceAsStream("images/bing_maps.png")); ++ final InputStream imageResource = JMapViewer.class.getResourceAsStream("images/bing_maps.png"); ++ if (imageResource != null) { ++ return ImageIO.read(imageResource); ++ } else { ++ if (this.BrandLogoUri != null) ++ return ImageIO.read(new URL(this.BrandLogoUri)); ++ else ++ return null; ++ } + } catch (IOException e) { + return null; + } diff --git a/debian/patches/series b/debian/patches/series index 32e8c24..d21e4d8 100644 --- a/debian/patches/series +++ b/debian/patches/series @@ -1,2 +1,3 @@ 01-build_less.patch 03-use-installed-library-in-demo.patch +04-bing-logo.patch -- Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-grass/jmapviewer.git _______________________________________________ Pkg-grass-devel mailing list Pkg-grass-devel@lists.alioth.debian.org http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-grass-devel