Modify

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 Don-vip

What's the use case of having two map views?

comment:2 Changed 21 months ago by michael2402

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

Last edited 21 months ago by michael2402 (previous) (diff)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set.
to The owner will be changed from team to the specified user.
The owner will change to michael2402
as duplicate The resolution will be set to duplicate.The specified ticket will be cross-referenced with this ticket
The owner will be changed from team to anonymous.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.