Polygon symbols default disabled, fix #405

This commit is contained in:
Emux 2018-01-28 11:33:37 +02:00
parent c93bb64a8a
commit 1ba83801e9
No known key found for this signature in database
GPG Key ID: 89C6921D7AF2BDD0
3 changed files with 13 additions and 3 deletions

View File

@ -9,6 +9,7 @@
- Internal render themes improvements [#488](https://github.com/mapsforge/vtm/pull/488)
- Map view roll [#474](https://github.com/mapsforge/vtm/pull/474)
- Fling animation improvements [#489](https://github.com/mapsforge/vtm/pull/489)
- Polygon symbols default disabled [#405](https://github.com/mapsforge/vtm/issues/405)
- Map fractional zoom [#487](https://github.com/mapsforge/vtm/issues/487)
- Render theme fallback internal resources [#477](https://github.com/mapsforge/vtm/issues/477)
- Fix FadeStep alpha interpolation [#486](https://github.com/mapsforge/vtm/issues/486)

View File

@ -1,6 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2016-2017 devemux86
* Copyright 2016-2018 devemux86
* Copyright 2016 Andrey Novikov
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
@ -126,6 +126,10 @@ public class LabelTileLoaderHook implements TileLoaderThemeHook {
// TODO
} else if (element.type == POLY) {
PointF centroid = element.labelPosition;
if (!Parameters.POLY_SYMBOL) {
if (centroid == null)
return false;
}
// skip unnecessary calculations if centroid is outside of visible area
if (centroid != null && (centroid.x < 0 || centroid.x > Tile.SIZE || centroid.y < 0 || centroid.y > Tile.SIZE))
return false;

View File

@ -1,5 +1,5 @@
/*
* Copyright 2017 devemux86
* Copyright 2017-2018 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
@ -32,10 +32,15 @@ public final class Parameters {
public static int MAXIMUM_BUFFER_SIZE = 8000000;
/**
* Optimal placement of text labels on polygons.
* Optimal placement of labels or symbols on polygons.
*/
public static boolean POLY_LABEL = false;
/**
* Placement of symbols on polygons.
*/
public static boolean POLY_SYMBOL = false;
/**
* POT textures in themes.
*/