From 305032707beedba6e85785a3818be5e076d8b7c2 Mon Sep 17 00:00:00 2001 From: Hannes Janetzek Date: Sat, 25 Jan 2014 21:45:18 +0100 Subject: [PATCH] google maps tiles --- .../tiling/source/bitmap/DefaultSources.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java b/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java index 39a49858..e9c6f1ad 100644 --- a/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java +++ b/vtm/src/org/oscim/tiling/source/bitmap/DefaultSources.java @@ -93,6 +93,34 @@ public class DefaultSources { } } + /** + * Do not use in applications unless you read through and comply to + * the terms of use! Only added here for testing puposes, + * https://github.com/opensciencemap/vtm/issues/18 + * + * https://developers.google.com/maps/faq + */ + public static class GoogleMaps extends BitmapTileSource { + public static final GoogleMaps INSTANCE = new GoogleMaps("http://mt1.google.com"); + + public GoogleMaps(String hostName) { + super(hostName, 1, 20, "image/png", ""); //jpeg for sat + } + + @Override + public String getTileUrl(Tile tile) { + StringBuilder sb = new StringBuilder(60); + sb.append("/vt/x="); //lyrs=y& + sb.append(tile.tileX); + sb.append("&y="); + sb.append(tile.tileY); + sb.append("&z="); + sb.append(tile.zoomLevel); + sb.append("&s=Galileo&scale=2"); + return sb.toString(); + } + } + final static FadeStep[] fadeSteps = new FadeStep[] { new FadeStep(0, 8 - 1, 1, 0.7f), // dont fade between zoom-min/max