extract theme assets to vtm-themes project
This commit is contained in:
@@ -23,7 +23,7 @@ import org.oscim.core.MapPosition;
|
||||
import org.oscim.core.Tile;
|
||||
import org.oscim.layers.tile.vector.VectorTileLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
import org.oscim.tiling.source.mapfile.MapFileTileSource;
|
||||
import org.oscim.tiling.source.mapfile.MapInfo;
|
||||
|
||||
@@ -68,17 +68,17 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
}
|
||||
@@ -100,17 +100,17 @@ public class MapsforgeMapActivity extends MapActivity {
|
||||
if (mTileSource.setMapFile(file)) {
|
||||
|
||||
VectorTileLayer l = mMap.setBaseMap(mTileSource);
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
mMap.layers().add(new LabelLayer(mMap, l));
|
||||
|
||||
MapInfo info = mTileSource.getMapInfo();
|
||||
if (info.boundingBox != null) {
|
||||
MapPosition pos = new MapPosition();
|
||||
pos.setByBoundingBox(info.boundingBox,
|
||||
Tile.SIZE * 4,
|
||||
Tile.SIZE * 4);
|
||||
Tile.SIZE * 4,
|
||||
Tile.SIZE * 4);
|
||||
mMap.setMapPosition(pos);
|
||||
Samples.log.debug("set position {}",pos);
|
||||
Samples.log.debug("set position {}", pos);
|
||||
} else if (info.mapCenter != null) {
|
||||
|
||||
double scale = 1 << 8;
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
import org.oscim.layers.tile.vector.BuildingLayer;
|
||||
import org.oscim.layers.tile.vector.labeling.LabelLayer;
|
||||
import org.oscim.map.Layers;
|
||||
import org.oscim.theme.InternalRenderTheme;
|
||||
import org.oscim.theme.VtmThemes;
|
||||
|
||||
import android.os.Bundle;
|
||||
import android.view.Menu;
|
||||
@@ -36,9 +36,10 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
|
||||
//layers.add(new TileGridLayer(mMap));
|
||||
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
//mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
//mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
//mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
//mMap.setTheme(VtmThemes.TRON2);
|
||||
//mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
|
||||
mMap.setMapPosition(53.08, 8.83, Math.pow(2, 10));
|
||||
}
|
||||
@@ -54,17 +55,17 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
|
||||
switch (item.getItemId()) {
|
||||
case R.id.theme_default:
|
||||
mMap.setTheme(InternalRenderTheme.DEFAULT);
|
||||
mMap.setTheme(VtmThemes.DEFAULT);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_tubes:
|
||||
mMap.setTheme(InternalRenderTheme.TRONRENDER);
|
||||
mMap.setTheme(VtmThemes.TRONRENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
|
||||
case R.id.theme_osmarender:
|
||||
mMap.setTheme(InternalRenderTheme.OSMARENDER);
|
||||
mMap.setTheme(VtmThemes.OSMARENDER);
|
||||
item.setChecked(true);
|
||||
return true;
|
||||
}
|
||||
@@ -77,18 +78,18 @@ public class SimpleMapActivity extends BaseMapActivity {
|
||||
mMapView.postDelayed(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
InternalRenderTheme t;
|
||||
VtmThemes t;
|
||||
if (i == 0)
|
||||
t = InternalRenderTheme.DEFAULT;
|
||||
t = VtmThemes.DEFAULT;
|
||||
else if (i == 1)
|
||||
t = InternalRenderTheme.TRONRENDER;
|
||||
t = VtmThemes.TRONRENDER;
|
||||
else
|
||||
t = InternalRenderTheme.OSMARENDER;
|
||||
t = VtmThemes.OSMARENDER;
|
||||
|
||||
mMapView.getMap().setTheme(t);
|
||||
|
||||
loooop((i + 1) % 3);
|
||||
}
|
||||
}, 300 + (int)(Math.random() * 200));
|
||||
}, 300 + (int) (Math.random() * 200));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user