Compare commits

...

4 Commits

13 changed files with 2484 additions and 16 deletions

View File

@ -21,7 +21,7 @@ allprojects {
static def androidCompileSdk() { return 33 }
// 14 for Support Library, 16 for sqlite-android
// 14 for Support Library
static def androidMinSdk() { return 21 }
static def androidTargetSdk() { return 33 }

View File

@ -2,6 +2,7 @@
## New since 0.19.0
- Motorider map theme [#1045](https://github.com/mapsforge/vtm/pull/1045)
- Minor improvements and bug fixes
- [Solved issues](https://github.com/mapsforge/vtm/issues?q=is%3Aclosed+milestone%3A0.20.0)

View File

@ -17,10 +17,6 @@ dependencies {
implementation project(':vtm-gdx-poi3d')
implementation 'org.mapsforge:mapsforge-poi-android:master-SNAPSHOT'
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-armeabi-v7a'
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-arm64-v8a'
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86'
runtimeOnly 'org.mapsforge:sqlite-android:master-SNAPSHOT:natives-x86_64'
}
android {

View File

@ -131,16 +131,26 @@ public class InputHandler implements InputProcessor {
break;
case Input.Keys.NUM_4:
mMap.setTheme(VtmThemes.OSMAGRAY);
mMap.setTheme(VtmThemes.MOTORIDER);
mMap.updateMap(false);
break;
case Input.Keys.NUM_5:
mMap.setTheme(VtmThemes.TRONRENDER);
mMap.setTheme(VtmThemes.MOTORIDER_DARK);
mMap.updateMap(false);
break;
case Input.Keys.NUM_6:
mMap.setTheme(VtmThemes.OSMAGRAY);
mMap.updateMap(false);
break;
case Input.Keys.NUM_7:
mMap.setTheme(VtmThemes.TRONRENDER);
mMap.updateMap(false);
break;
case Input.Keys.NUM_8:
mMap.setTheme(VtmThemes.NEWTRON);
mMap.updateMap(false);
break;

View File

@ -44,6 +44,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import static org.oscim.core.MercatorProjection.latitudeToY;
@ -66,6 +68,7 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
protected final SpatialIndex<Drawable> mDrawables = new QuadTree<Drawable>(1 << 30, 18);
protected final List<Drawable> tmpDrawables = new ArrayList<Drawable>(128);
private final Comparator<Drawable> mComparator;
protected final JtsConverter mConverter;
protected double mMinX;
@ -74,10 +77,16 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
private static class GeometryWithStyle implements Drawable {
final Geometry geometry;
final Style style;
final int priority;
GeometryWithStyle(Geometry g, Style s) {
this(g, s, 0);
}
GeometryWithStyle(Geometry g, Style s, int p) {
geometry = g;
style = s;
priority = p;
}
@Override
@ -89,6 +98,11 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
public Geometry getGeometry() {
return geometry;
}
@Override
public int getPriority() {
return priority;
}
}
protected Polygon mEnvelope;
@ -100,6 +114,12 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
public VectorLayer(Map map) {
super(map);
mConverter = new JtsConverter(Tile.SIZE / UNSCALE_COORD);
mComparator = new Comparator<Drawable>() {
@Override
public int compare(Drawable o1, Drawable o2) {
return Integer.compare(o1.getPriority(), o2.getPriority());
}
};
}
private static Box bbox(Geometry geometry, Style style) {
@ -199,7 +219,8 @@ public class VectorLayer extends AbstractVectorLayer<Drawable> implements Gestur
synchronized (this) {
tmpDrawables.clear();
mDrawables.search(bbox, tmpDrawables);
// TODO sort by some order...
// sort by some order...
Collections.sort(tmpDrawables, mComparator);
for (Drawable d : tmpDrawables) {
Style style = d.getStyle();

View File

@ -13,4 +13,11 @@ public interface Drawable {
* @return
*/
public Geometry getGeometry();
/**
* Priority of drawable, the larger the value, the higher it will appear when drawn in the VectorLayer.
*
* @see org.oscim.layers.vector.VectorLayer processFeatures() method
*/
public int getPriority();
}

View File

@ -20,6 +20,7 @@ public class JtsDrawable implements Drawable {
protected Style style;
protected Geometry geometry;
protected int priority = 0;
public JtsDrawable(Style style) {
this.style = style;
@ -53,6 +54,15 @@ public class JtsDrawable implements Drawable {
return geometry;
}
@Override
public int getPriority() {
return priority;
}
public void setPriority(int priority) {
this.priority = priority;
}
protected static GeomBuilder loadPoints(GeomBuilder gb, List<GeoPoint> points) {
for (GeoPoint point : points) {
gb.point(point.getLongitude(),

View File

@ -5,7 +5,7 @@
<!-- Styles -->
<stylemenu defaultlang="en" defaultvalue="normal" id="menu">
<layer enabled="true" id="accommodation">
<layer id="accommodation">
<name lang="ar" value="أماكن إقامة" />
<name lang="de" value="Unterkunft" />
<name lang="el" value="Διαμονή" />
@ -16,7 +16,7 @@
<name lang="nl" value="Onderkomen" />
<cat id="accommodation" />
</layer>
<layer enabled="true" id="food">
<layer id="food">
<name lang="ar" value="طعام" />
<name lang="de" value="Lebensmittel" />
<name lang="el" value="Φαγητό" />
@ -71,7 +71,7 @@
<name lang="nl" value="Parkeerplaatsen" />
<cat id="parking" />
</layer>
<layer enabled="true" id="mountain_pass">
<layer id="mountain_pass">
<name lang="ar" value="معابر جبلية" />
<name lang="de" value="Bergpässe" />
<name lang="el" value="Ορεινά περάσματα" />
@ -82,7 +82,7 @@
<name lang="nl" value="Bergpassen" />
<cat id="mountain_pass" />
</layer>
<layer enabled="true" id="mountain_peak">
<layer id="mountain_peak">
<name lang="ar" value="قمم الجبال" />
<name lang="de" value="Bergspitzen" />
<name lang="el" value="Ορεινές κορυφές" />

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -34,6 +34,8 @@ public enum VtmThemes implements ThemeFile {
DEFAULT("vtm/default.xml"),
BIKER("vtm/biker.xml"),
MAPZEN("vtm/mapzen.xml"),
MOTORIDER("vtm/motorider.xml"),
MOTORIDER_DARK("vtm/motorider-dark.xml"),
NEWTRON("vtm/newtron.xml"),
OPENMAPTILES("vtm/openmaptiles.xml"),
OSMAGRAY("vtm/osmagray.xml"),

View File

@ -4,8 +4,8 @@ buildscript {
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'org.wisepersist:gwt-gradle-plugin:1.1.15'
classpath 'org.gretty:gretty:4.0.0'
classpath 'org.wisepersist:gwt-gradle-plugin:1.1.19'
classpath 'org.gretty:gretty:4.0.3'
}
}
@ -59,7 +59,7 @@ gwt {
}
farm {
webapp draftWar.archivePath, contextPath: "/$name"
webapp draftWar.getArchiveFile().get(), contextPath: "/$name"
}
project.afterEvaluate {

View File

@ -3,7 +3,7 @@ buildscript {
mavenCentral()
}
dependencies {
classpath 'org.wisepersist:gwt-gradle-plugin:1.1.15'
classpath 'org.wisepersist:gwt-gradle-plugin:1.1.19'
}
}