Map scaling improvements, fix #401
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
- Render themes: tag transform [#420](https://github.com/mapsforge/vtm/issues/420)
|
||||
- Render themes: PNG scaling [#595](https://github.com/mapsforge/vtm/issues/595)
|
||||
- Building shadows [#575](https://github.com/mapsforge/vtm/issues/575)
|
||||
- Map scaling improvements [#401](https://github.com/mapsforge/vtm/issues/401)
|
||||
- PathLayer(s) scaled width [#594](https://github.com/mapsforge/vtm/issues/594)
|
||||
- Mapilion MVT vector tiles & Hillshading [#614](https://github.com/mapsforge/vtm/issues/614)
|
||||
- Overpass tile source [#663](https://github.com/mapsforge/vtm/issues/663)
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Copyright 2012-2014 Hannes Janetzek
|
||||
* Copyright 2016-2017 devemux86
|
||||
* Copyright 2016-2019 devemux86
|
||||
*
|
||||
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
|
||||
*
|
||||
@@ -51,7 +51,7 @@ public class VectorTileLoader extends TileLoader implements RenderStyle.Callback
|
||||
|
||||
static final Logger log = LoggerFactory.getLogger(VectorTileLoader.class);
|
||||
|
||||
protected static final double STROKE_INCREASE = Math.sqrt(2.5);
|
||||
protected static final double STROKE_INCREASE = 1.4;
|
||||
protected static final byte LAYERS = 11;
|
||||
|
||||
public static final byte STROKE_MIN_ZOOM = 12;
|
||||
|
||||
@@ -171,7 +171,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
RenderTheme mRenderTheme;
|
||||
|
||||
final boolean mMapsforgeTheme;
|
||||
private final float mScale, mScale2;
|
||||
private final float mScale;
|
||||
|
||||
private Set<String> mCategories;
|
||||
private XmlRenderThemeStyleLayer mCurrentLayer;
|
||||
@@ -189,7 +189,6 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
mThemeCallback = themeCallback;
|
||||
mMapsforgeTheme = theme.isMapsforgeTheme();
|
||||
mScale = CanvasAdapter.getScale();
|
||||
mScale2 = CanvasAdapter.getScale() * 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -550,7 +549,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
b.color(value);
|
||||
|
||||
else if ("width".equals(name) || "stroke-width".equals(name)) {
|
||||
b.strokeWidth = parseFloat(value) * mScale2 * mStrokeScale;
|
||||
b.strokeWidth = parseFloat(value) * mScale * mStrokeScale;
|
||||
if (line == null) {
|
||||
if (!isOutline)
|
||||
validateNonNegative("width", b.strokeWidth);
|
||||
@@ -567,7 +566,7 @@ public class XmlThemeBuilder extends DefaultHandler {
|
||||
b.fixed = parseBoolean(value);
|
||||
|
||||
else if ("stipple".equals(name))
|
||||
b.stipple = Math.round(parseInt(value) * mScale2 * mStrokeScale);
|
||||
b.stipple = Math.round(parseInt(value) * mScale * mStrokeScale);
|
||||
|
||||
else if ("stipple-stroke".equals(name))
|
||||
b.stippleColor(value);
|
||||
|
||||
Reference in New Issue
Block a user