diff --git a/vtm-android-example/src/org/oscim/android/test/BitmapTileMapActivity.java b/vtm-android-example/src/org/oscim/android/test/BitmapTileMapActivity.java index 069b60ce..4a6b9c3b 100644 --- a/vtm-android-example/src/org/oscim/android/test/BitmapTileMapActivity.java +++ b/vtm-android-example/src/org/oscim/android/test/BitmapTileMapActivity.java @@ -17,7 +17,10 @@ package org.oscim.android.test; import org.oscim.android.MapActivity; import org.oscim.android.MapView; import org.oscim.android.cache.TileCache; +import org.oscim.backend.canvas.Color; +import org.oscim.layers.TileGridLayer; import org.oscim.layers.tile.BitmapTileLayer; +import org.oscim.renderer.MapRenderer; import org.oscim.tiling.source.TileSource; import org.oscim.tiling.source.bitmap.DefaultSources; @@ -48,6 +51,9 @@ public class BitmapTileMapActivity extends MapActivity { mMapView = (MapView) findViewById(R.id.mapView); registerMapView(mMapView); + MapRenderer.setBackgroundColor(0xff777777); + mMap.getLayers().add(new TileGridLayer(mMap, Color.GRAY, 1.8f, 8)); + if (USE_CACHE) { mCache = new TileCache(this, null, mTileSource.getClass().getSimpleName()); mCache.setCacheSize(512 * (1 << 10)); diff --git a/vtm/src/org/oscim/layers/TileGridLayer.java b/vtm/src/org/oscim/layers/TileGridLayer.java index 1d2760e7..7ab673a5 100644 --- a/vtm/src/org/oscim/layers/TileGridLayer.java +++ b/vtm/src/org/oscim/layers/TileGridLayer.java @@ -1,7 +1,10 @@ package org.oscim.layers; +import org.oscim.backend.canvas.Paint.Cap; import org.oscim.map.Map; import org.oscim.renderer.GridRenderer; +import org.oscim.theme.styles.Line; +import org.oscim.theme.styles.Text; public class TileGridLayer extends GenericLayer { @@ -9,4 +12,11 @@ public class TileGridLayer extends GenericLayer { super(map, new GridRenderer()); } + public TileGridLayer(Map map, int color, float width, int repeat) { + super(map, new GridRenderer(repeat, new Line(color, width, Cap.BUTT), null)); + } + + public TileGridLayer(Map map, int color, float width, Text text, int repeat) { + super(map, new GridRenderer(repeat, new Line(color, width, Cap.BUTT), text)); + } }