From 1ba83801e994d78682b2ceeb31ca4f8d617392e6 Mon Sep 17 00:00:00 2001 From: Emux Date: Sun, 28 Jan 2018 11:33:37 +0200 Subject: [PATCH] Polygon symbols default disabled, fix #405 --- docs/Changelog.md | 1 + .../layers/tile/vector/labeling/LabelTileLoaderHook.java | 6 +++++- vtm/src/org/oscim/utils/Parameters.java | 9 +++++++-- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/docs/Changelog.md b/docs/Changelog.md index 5437313a2..bd9626a15 100644 --- a/docs/Changelog.md +++ b/docs/Changelog.md @@ -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) diff --git a/vtm/src/org/oscim/layers/tile/vector/labeling/LabelTileLoaderHook.java b/vtm/src/org/oscim/layers/tile/vector/labeling/LabelTileLoaderHook.java index 1a2d1a125..bbab31db3 100644 --- a/vtm/src/org/oscim/layers/tile/vector/labeling/LabelTileLoaderHook.java +++ b/vtm/src/org/oscim/layers/tile/vector/labeling/LabelTileLoaderHook.java @@ -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 boolean process(MapTile tile, RenderBuckets buckets, MapElement element, // 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; diff --git a/vtm/src/org/oscim/utils/Parameters.java b/vtm/src/org/oscim/utils/Parameters.java index f085f70ab..486c64bb5 100644 --- a/vtm/src/org/oscim/utils/Parameters.java +++ b/vtm/src/org/oscim/utils/Parameters.java @@ -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. */