You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Label layer with MapDataStoreLabelStore shows less symbols #1631
When we use a label layer with label cache (e.g. LabelLayerUsingLabelCacheMapViewer)
or we do not use a label layer (e.g. SimplestMapViewer), we see the correct first 2 images.
When we use a label layer with MapDataStoreLabelStore (e.g. LabelLayerUsingMapDataStoreMapViewer),
we see the wrong third image with much less symbols.
Was always the case or it is a result of the map label / symbol improvements in #1579#1586#1588 ?
I don't know if we really need the label layer as in the LabelLayerUsingMapDataStoreMapViewer implementation.
Its simultaneous reading of map file can cause problems
and it shows the symbols / labels with delay, especially with large maps.
This makes it not usable in fast scroll / zoom actions.
Just don't remove MapDataStoreLabelStore, as direct rendering depends on it. It's better to have it like this than not have it at all. Hopefully this will be fixed at some point.
Really don't know. Is there something wrong with the algorithm of the MapDataStoreLabelStore.getVisibleItems()?
Confirmed. It seems that missing symbols are never returned from that method.
Can you or @ludwigb take a look into that? We only made cosmetic changes there.
@Sublimis Maybe, as the other 2 Mapsforge themes are very simple and not maintained anymore.
Tests better be done with Motorider and Elevate themes.
Probably a polygon appears too early or other elements.
Theme commit history will help here.
In the past we had problems with forests in Germany map and lakes in Netherlands map.
As both types have too many complex polygons and these countries have too many of them.
I am not an Android programmer, so I don't have the dev/debug tools ready to go - I mainly edit the theme XML and keep pressing F5 in Cruiser Desktop (on Windoze) until I'm happy, then I load it into the Cruiser App. It's solid, reliable and I am fairly certain that any of the handful of "crashes" within Cruiser have been a result of other functions failing rather than trying to "confuse" the map rendering with the Bishop Knife Trick ™ on the zoom-in/out buttons 😆
It sounds to me like there is a lot going on with OAMaps in terms of mapping data and what else may be appearing at earlier zoom levels. Perhaps if a crash in a specific area can be replicated, it may narrow-down the culprit tag?
If render theme does not have zoom-min in a rule, then the zoom-appear of tag-mapping is used.
(which could be a much smaller zoom than we want especially for map performance)
OpenAndroMaps use a different tag-mapping available here.
So in essence, the MotoRider theme is not designed to be 100% OAM compatible, and basically only their Elevate/Elements themes are made that way? Sorry, didn't know that.
In the end, it seems that this really is some kind of "out of resources" error at the HW level due to a lot of drawing, everything points to that, because the error goes away when we manipulate the number of paths drawn (by hacking the code). The good thing is that this only happens often on one older (albeit high-end) device, it seems that newer versions of Android are much harder to push into error. It is doable, unfortunately, but much harder.
Will try, and let you know. Presumably it won't happen, or it will be much harder to achieve.
Would you be so kind to take a look at #1641 and those black paths there. It's an OAM map, the black paths are normal roads, but it happens that at several zoom levels some roads look black. Is there perhaps a simple solution to this? This does not happen on Mapsforge maps, nor did it happen on OAM maps until several weeks ago.
@Sublimis Some map providers like OpenAndroMaps or Freizeitkarte may adapt / merge some OSM tags
in order to provide more or adapted information. So their maps usually work better with their themes.
For more details see the OpenAndroMaps tag-transform.
Mapsforge themes should always work with Mapsforge maps with the original OpenStreetMap tags.
I am not an Android programmer, so I don't have the dev/debug tools ready to go - I mainly edit the theme XML and keep pressing F5 in Cruiser Desktop (on Windoze) until I'm happy, then I load it into the Cruiser App. It's solid, reliable and I am fairly certain that any of the handful of "crashes" within Cruiser have been a result of other functions failing rather than trying to "confuse" the map rendering with the Bishop Knife Trick ™ on the zoom-in/out buttons 😆
As a general rule of thumb, the more things drawn on the screen, the more resources are used, which is probably understandable. If at all possible through the rendering theme, the number of "things" drawn on the screen at one time should be as small as practically possible. We have to keep in mind that the map is "just" part of some application, and the application has to draw and do its own thing at the same time 🙂
Also these are offline vector maps rendered in real time on mobile devices, so performance is very important.
They are not online bitmap tiles that were already prerendered on powerful servers and we just download them.
Would you be so kind to take a look at #1641 and those black paths there. It's an OAM map, the black paths are normal roads, but it happens that at several zoom levels some roads look black. Is there perhaps a simple solution to this? This does not happen on Mapsforge maps, nor did it happen on OAM maps until several weeks ago.
These should be road casings (e.g. highway=service) without the road core.
In Mapsforge maps they appear later.
@Sublimis@devemux86 I have found+fixed the service road issue - as they are tagged to appear at zoom-14 in Mapsforge I have removed the old zoom-12+13 declarations (redundant for me as I'd never have seen them with a Mapsforge map!). OAMaps loaded them early because of those 2 entries in the theme and it's different tag-mapping rules.
There was no deliberate intention to have themes not work with other maps - there have been a few fixes specifically for OAMaps (ie: a contour lines "Layer") plus nosea for Freizeitkarte. I'll try maps from all 3 providers in future to ensure that what I see is what most people also see!
Aside from this small tweak, almost every possible synchronization and hack has been tried to fix the crash mentioned above, but to no avail. (╯°□°)╯︵ ┻━┻
It remains a mystery how it is possible for one XML to cause a crash and another (*comparable) not, while changes in Java make no difference.
(*) Comparable because the other (outdated themes) are no simpler than the Motorider themes. We counted the points and labels, they are comparable in the complexity of the drawing. It must be something else. (In case anyone is wondering, the number of points was in the range of 500'000-2'000'000, the number of paths about 5x less on average, and the number of labels about 100'000)
Activity
Sublimis commentedon Jan 18, 2025
This seems to happen only with the blue symbols (e.g. parking, accommodation, etc.), can this be some clue?
devemux86 commentedon Jan 18, 2025
@Sublimis There are many parking symbols. They still appear, but much less.
Sublimis commentedon Jan 18, 2025
v0.22 is similar, so it was before that time
Sublimis commentedon Jan 18, 2025
Yes, but why only blue symbols and not brown symbols? There are no brown symbols in your screenshots, but zoom in a bit to convince yourself.
devemux86 commentedon Jan 18, 2025
Parking happens to have a lot of symbols, so the difference is clearly visible.
devemux86 commentedon Jan 18, 2025
I don't know if we really need the label layer as in the
LabelLayerUsingMapDataStoreMapViewerimplementation.Its simultaneous reading of map file can cause problems
and it shows the symbols / labels with delay, especially with large maps.
This makes it not usable in fast scroll / zoom actions.
Sublimis commentedon Jan 18, 2025
Really don't know. Is there something wrong with the algorithm of the
MapDataStoreLabelStore.getVisibleItems()?Sublimis commentedon Jan 18, 2025
Just don't remove
MapDataStoreLabelStore, as direct rendering depends on it. It's better to have it like this than not have it at all. Hopefully this will be fixed at some point.Sublimis commentedon Jan 18, 2025
Confirmed. It seems that missing symbols are never returned from that method.
Can you or @ludwigb take a look into that? We only made cosmetic changes there.
devemux86 commentedon Jan 19, 2025
The reason is simple: line 72
mapDataStore.readLabels, i.e. pois and ways that have a name.It works correctly if we replace it with
readMapData.MapDataStoreLabelStore.getVisibleItems read all map data, fix #1631
MapDataStoreLabelStore.getVisibleItems read all map data, fix #1631 (#…
15 remaining items
devemux86 commentedon Jan 22, 2025
@Sublimis Maybe, as the other 2 Mapsforge themes are very simple and not maintained anymore.
Tests better be done with Motorider and Elevate themes.
Probably a polygon appears too early or other elements.
Theme commit history will help here.
In the past we had problems with forests in Germany map and lakes in Netherlands map.
As both types have too many complex polygons and these countries have too many of them.
MotoUKRider commentedon Jan 23, 2025
@Sublimis As you allude, the OAMaps are a different animal to Mapsforge, for example: Switzerland 980MB vs 296MB as they contain contours and extra data - There is also a definite "things appear early" rule in the tag-mapping as I noticed recently.
I am not an Android programmer, so I don't have the dev/debug tools ready to go - I mainly edit the theme XML and keep pressing F5 in Cruiser Desktop (on Windoze) until I'm happy, then I load it into the Cruiser App. It's solid, reliable and I am fairly certain that any of the handful of "crashes" within Cruiser have been a result of other functions failing rather than trying to "confuse" the map rendering with the Bishop Knife Trick ™ on the zoom-in/out buttons 😆
It sounds to me like there is a lot going on with OAMaps in terms of mapping data and what else may be appearing at earlier zoom levels. Perhaps if a crash in a specific area can be replicated, it may narrow-down the culprit
tag?PS: Does this happen with a Mapsforge map, too?
devemux86 commentedon Jan 23, 2025
@MotoUKRider @Sublimis
If render theme does not have
zoom-minin a rule, then thezoom-appearof tag-mapping is used.(which could be a much smaller zoom than we want especially for map performance)
OpenAndroMaps use a different tag-mapping available here.
Sublimis commentedon Jan 23, 2025
So in essence, the MotoRider theme is not designed to be 100% OAM compatible, and basically only their Elevate/Elements themes are made that way? Sorry, didn't know that.
In the end, it seems that this really is some kind of "out of resources" error at the HW level due to a lot of drawing, everything points to that, because the error goes away when we manipulate the number of paths drawn (by hacking the code). The good thing is that this only happens often on one older (albeit high-end) device, it seems that newer versions of Android are much harder to push into error. It is doable, unfortunately, but much harder.
@MotoUKRider
Will try, and let you know. Presumably it won't happen, or it will be much harder to achieve.
Would you be so kind to take a look at #1641 and those black paths there. It's an OAM map, the black paths are normal roads, but it happens that at several zoom levels some roads look black. Is there perhaps a simple solution to this? This does not happen on Mapsforge maps, nor did it happen on OAM maps until several weeks ago.
devemux86 commentedon Jan 23, 2025
@Sublimis Some map providers like OpenAndroMaps or Freizeitkarte may adapt / merge some OSM tags
in order to provide more or adapted information. So their maps usually work better with their themes.
For more details see the OpenAndroMaps tag-transform.
Mapsforge themes should always work with Mapsforge maps with the original OpenStreetMap tags.
Sublimis commentedon Jan 23, 2025
As a general rule of thumb, the more things drawn on the screen, the more resources are used, which is probably understandable. If at all possible through the rendering theme, the number of "things" drawn on the screen at one time should be as small as practically possible. We have to keep in mind that the map is "just" part of some application, and the application has to draw and do its own thing at the same time 🙂
devemux86 commentedon Jan 23, 2025
Also these are offline vector maps rendered in real time on mobile devices, so performance is very important.
They are not online bitmap tiles that were already prerendered on powerful servers and we just download them.
devemux86 commentedon Jan 23, 2025
These should be road casings (e.g. highway=service) without the road core.
In Mapsforge maps they appear later.
cc @MotoUKRider
Sublimis commentedon Jan 23, 2025
Update: Unfortunately yes. And with the same effort, it's no harder to achieve...
Sublimis commentedon Jan 23, 2025
Exactly.
MotoUKRider commentedon Jan 23, 2025
@Sublimis @devemux86 I have found+fixed the
serviceroad issue - as they are tagged to appear at zoom-14 in Mapsforge I have removed the old zoom-12+13 declarations (redundant for me as I'd never have seen them with a Mapsforge map!). OAMaps loaded them early because of those 2 entries in the theme and it's different tag-mapping rules.I have posted a fix of this here.
There was no deliberate intention to have themes not work with other maps - there have been a few fixes specifically for OAMaps (ie: a contour lines "Layer") plus
noseafor Freizeitkarte. I'll try maps from all 3 providers in future to ensure that what I see is what most people also see!devemux86 commentedon Jan 23, 2025
@MotoUKRider Thanks, I merged it! 👍
Sublimis commentedon Jan 23, 2025
That's great, thank you both!
Sublimis commentedon Jan 27, 2025
@MotoUKRider #1644
Aside from this small tweak, almost every possible synchronization and hack has been tried to fix the crash mentioned above, but to no avail. (╯°□°)╯︵ ┻━┻
It remains a mystery how it is possible for one XML to cause a crash and another (*comparable) not, while changes in Java make no difference.
(*) Comparable because the other (outdated themes) are no simpler than the Motorider themes. We counted the points and labels, they are comparable in the complexity of the drawing. It must be something else. (In case anyone is wondering, the number of points was in the range of 500'000-2'000'000, the number of paths about 5x less on average, and the number of labels about 100'000)
Sublimis commentedon Feb 23, 2025
#1657