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 mappaintStyle in OsmPrimitive and VectorPrimitive becomes HashMap<ElemStyles,StyleCache> mappaintStyle.
  • Parameters of methods of Stylable interface are adjusted accordingly. Stylable.getCachedStyle() becomes Stylable.getCachedStyle(ElemStyles styles), e.t.c.

References

(Obviously it cannot be released until this issue in JOSM is fixed)

Change History (1)

by zkir, 7 days ago

Attachment: UrbanEye3D_style.jpg added
Note: See TracTickets for help on using tickets.