Opened 7 days ago
Last modified 4 days ago
#24637 closed defect
[PATCH] MapCSS style cache should be dependent on ElemStyles instance — at Initial Version
| Reported by: | zkir | Owned by: | team |
|---|---|---|---|
| Priority: | normal | Milestone: | 26.03 |
| Component: | Core mappaint | Version: | |
| Keywords: | MapCSS, ElemStyles, style cache, UrbanEye3D | Cc: |
Description
Use Case
The UbanEye3D plugin displays the active dataset in its own window with MapCSS style which can be different from the MapCSS style used in the main JOSM map view window.
(picture: see attachments).
The issue in JOSM with MapCSS styles.
In JOSM, MapCSS style (style set) is represented as an instance of ElemStyles class. There can be several such instances. However, currently there is only one cache for all instances of ElemStyles, which leads to the problem that only one style can be applied to all windows, and sometime crashes are produced, if different styles are specified.
Suggested solution
Make the style cache dependent on ElemStyles instance:
StyleCache mappaintStylein OsmPrimitive and VectorPrimitive becomesHashMap<ElemStyles,StyleCache> mappaintStyle.- Parameters of methods of Stylable interface are adjusted accordingly.
Stylable.getCachedStyle()becomesStylable.getCachedStyle(ElemStyles styles), e.t.c.
References
- UrbanEye3D branch with the feature in question can be found here: https://github.com/Zkir/UrbanEye3D/tree/mapcss-layer
(Obviously it cannot be released until this issue in JOSM is fixed)


