The attribute zoom-min="2" behaves like zoom-min="1" in the xml file with rendertheme #931
-
The problem/behaviour I am describing below is the same for my two devices, which is one tablet with Android 4.4 I have a labeling problem in an app where I am using 'mapsforge vtm'. Therefore I have now created a very small minimal app that reproduces the problem, and I have attached it in a zip file below. I am using Windows, and within the above attached zip file there is a bat file "map_creation\create_map.bat" which can be run (assuming that 'osmosis' and mapsforge mapfile-writer is installed). When the app is started, the map file (and the xml file with rendertheme) is automatically copied from the assets folder into the android app's directory which is then used as 'MapFileTileSource'. The bat file is creating the map file with this command:
Below is the most relevant (regarding this question/issue) content from the file "map_creation\map.osm":
Below is the most relevant content from the file "map_creation\tag-mapping.xml":
Below is the most relevant content from the file "app\src\main\assets\mapsforge_render.xml":
The map file (generated from "map_creation\map.osm") defines three polygons It works as expected when zooming in from level 2 to level 3, i.e. then the label "Africa" becomes shown, and it becomes hidden again when zooming out to level 2 again. In other words, the problem shown in the second screenshot below (at zoom level 1) is that only the label for 'North America' should be displayed, but not the label for 'South America' which should only be shown for level 2 and above. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
MapFileTileSource mapFileTileSource = new MapFileTileSource(1, 5);
map.layers().add(new LabelLayer(map, tileLayer, new LabelTileLoaderHook(), 5)); |
Beta Was this translation helpful? Give feedback.
-
Yes indeed it worked. Thank you ! |
Beta Was this translation helpful? Give feedback.
The
ViewPort
setters must be called before creating the layersThe layer constructors with the custom zoom levels are needed: