Opened 21 months ago
Last modified 21 months ago
#21085 new enhancement
Make OSM Data layer usable in two map views
Reported by: | michael2402 | Owned by: | team |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | Core mappaint | Version: | |
Keywords: | Cc: |
Description
Currently, an 'OsmDataLayer' can only be used in one map view.
If one wants to create a second map view with a different mapcss style, one needs to copy over the whole data set and create a new OsmDataLayer, just because each Node/Way/Relation contains a cache of the style and that cache is not intended to be used by multiple MapViews.
*Workaround*
Create a second data set, attach event listeners to the original one and sync all changes. Use that data set for the second map view
*More performant Solution*
Do not include the style cache in the Node/Way/Relation.
Use an IdentityHashMap in the layer painter and store the style cache there. Listen to layer change events to evict changed items out of the cache.
Attachments (0)
Change History (2)
comment:1 Changed 21 months ago by
comment:2 Changed 21 months ago by
I don't see any for core. I saw one for PT plugin, but I used the workaround there, which is working fine (since I don't need edit interaction and only want to display primitives, this is perfectly fine)
Some Screenshots in the old PR:
https://github.com/JOSM/pt_assistant/pull/36
What's the use case of having two map views?