vtm-web-app: include theme with texture atlas symbols #51

This commit is contained in:
Emux 2017-02-06 20:07:55 +02:00
parent fdc793d9ec
commit f2dda7c8eb
7 changed files with 1264 additions and 4 deletions

View File

@ -1,4 +1,4 @@
<atlas img="icons/maki.png">
<atlas img="atlas/maki.png">
<rect id="airfield" pos="1 105 24 24" />
<rect id="airport" pos="1 79 24 24" />
<rect id="alcohol-shop" pos="27 105 24 24" />

View File

@ -1,4 +1,4 @@
<atlas img="icons/osm.png">
<atlas img="atlas/osm.png">
<rect id="airport" pos="1 40 16 16" />
<rect id="atm" pos="19 40 16 16" />
<rect id="bar" pos="1 80 20 20" />

View File

@ -1,4 +1,4 @@
<atlas img="icons/osmarender.png">
<atlas img="atlas/osmarender.png">
<rect id="airport" pos="226 38 24 24" />
<rect id="alpine_hut" pos="198 41 26 21" />
<rect id="atm" pos="279 2 14 16" />

View File

@ -68,6 +68,12 @@ task copyThemeAssets(type: Copy) {
include '**/*'
}
task copyThemeLocalAssets(type: Copy) {
from "resources/assets"
into "assets"
include '**/*'
}
task copyVtmAssets(type: Copy) {
from "$rootDir/vtm/resources/assets"
into "assets"
@ -82,6 +88,7 @@ task copyWarSources(type: Copy) {
tasks.withType(JavaCompile) { compileTask ->
compileTask.dependsOn copyThemeAssets
compileTask.dependsOn copyThemeLocalAssets
compileTask.dependsOn copyVtmAssets
compileTask.dependsOn copyWarSources
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

File diff suppressed because it is too large Load Diff

View File

@ -21,6 +21,7 @@ package org.oscim.web.client;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.backends.gwt.GwtApplication;
import org.oscim.backend.AssetAdapter;
import org.oscim.backend.CanvasAdapter;
import org.oscim.backend.GL;
import org.oscim.backend.GLAdapter;
@ -36,6 +37,7 @@ import org.oscim.layers.tile.buildings.S3DBLayer;
import org.oscim.layers.tile.vector.VectorTileLayer;
import org.oscim.layers.tile.vector.labeling.LabelLayer;
import org.oscim.renderer.MapRenderer;
import org.oscim.theme.StreamRenderTheme;
import org.oscim.theme.VtmThemes;
import org.oscim.tiling.TileSource;
import org.oscim.tiling.source.bitmap.BitmapTileSource;
@ -115,7 +117,8 @@ class GwtMap extends GdxMap {
l = mMap.setBaseMap(ts);
if (themeName == null) {
mMap.setTheme(VtmThemes.DEFAULT);
// Local theme with texture atlas using png
mMap.setTheme(new StreamRenderTheme("", AssetAdapter.readFileAsStream("vtm/default_atlas.xml")));
} else {
if ("osmarender".equals(themeName))
mMap.setTheme(VtmThemes.OSMARENDER);