Skip to content

Commit

Permalink
Polygon symbols default disabled, fix #405
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Jan 28, 2018
1 parent c93bb64 commit 1ba8380
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
1 change: 1 addition & 0 deletions docs/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
@@ -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).
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 7 additions & 2 deletions vtm/src/org/oscim/utils/Parameters.java
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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.
*/
Expand Down

0 comments on commit 1ba8380

Please sign in to comment.