extract theme assets to vtm-themes project
This commit is contained in:
@@ -10,18 +10,19 @@ buildscript {
|
||||
apply plugin: 'android'
|
||||
|
||||
dependencies {
|
||||
//compile fileTree(dir: 'libs', include: '*.jar')
|
||||
compile project(':vtm-android')
|
||||
compile fileTree(dir: 'libs', include: '*.jar')
|
||||
compile project(':vtm-themes')
|
||||
}
|
||||
|
||||
task copyAssets(type: Copy) {
|
||||
from "$rootDir/vtm/assets"
|
||||
into "assets"
|
||||
include '**/*'
|
||||
}
|
||||
// task copyAssets(type: Copy) {
|
||||
// from "$rootDir/vtm/assets"
|
||||
// into "assets"
|
||||
// include '**/*'
|
||||
// }
|
||||
|
||||
tasks.withType(JavaCompile) { compileTask ->
|
||||
compileTask.dependsOn copyAssets }
|
||||
// tasks.withType(JavaCompile) { compileTask ->
|
||||
// compileTask.dependsOn copyAssets }
|
||||
|
||||
android {
|
||||
compileSdkVersion 19
|
||||
@@ -60,12 +61,12 @@ eclipse.classpath {
|
||||
|
||||
// Manipulation of the classpath XML before merging local
|
||||
// and generated copies
|
||||
beforeMerged { classpath ->
|
||||
// Remove all source entries to avoid overlap
|
||||
classpath.entries.removeAll() { c ->
|
||||
c.kind == 'src'
|
||||
}
|
||||
}
|
||||
// beforeMerged { classpath ->
|
||||
// // Remove all source entries to avoid overlap
|
||||
// classpath.entries.removeAll() { c ->
|
||||
// c.kind == 'src'
|
||||
// }
|
||||
// }
|
||||
|
||||
// Direct manipulation of the generated classpath XML
|
||||
withXml {
|
||||
@@ -82,14 +83,13 @@ eclipse.classpath {
|
||||
}
|
||||
|
||||
eclipse.project {
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
natures = ['com.android.ide.eclipse.adt.AndroidNature',
|
||||
'org.eclipse.jdt.core.javanature']
|
||||
|
||||
buildCommand 'com.android.ide.eclipse.adt.ResourceManagerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.PreCompilerBuilder'
|
||||
buildCommand 'com.android.ide.eclipse.adt.ApkBuilder'
|
||||
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm/assets'
|
||||
linkedResource name: 'assets', type: '2',
|
||||
locationUri: 'PARENT-1-PROJECT_LOC/vtm-themes/resources/assets'
|
||||
}
|
||||
|
||||
|
||||
@@ -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