Modify

Opened 4 years ago

Last modified 4 years 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 by Don-vip, 4 years ago

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

comment:2 by michael2402, 4 years ago

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 4 years 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. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to michael2402.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.