opensciencemap / vtm

a vector-tile map library written in java - running on android, desktop and within the browser
GNU Lesser General Public License v3.0
238 stars 176 forks source link

Multiple itemizedlayers rendering mixing up #151

Open dondos opened 9 years ago

dondos commented 9 years ago

I want to display around 150 individual markers on the map. The markers must be dynamic (they represent moving cars.) I have created a single item itemizedlayer for each marker. Everything work fine for about an hour (or more, depending on the number of markers) until everything is mixed up.

This is how it looks when it's working correctly: correct

and this is how it looks after an hour: wrong

If I zoom in far enough to have only one marker visible, then it's rendered correctly. But, as soon as more than one marker is visible on the map, one of the markers is displayed correctly and the others ones starts flickering between their marker icons and the "dominant" one.

I am only using three markers (green, red and blue). The number label on the marker is created dynamically with canvas.drawText().

hjanetzek commented 9 years ago

It may be possible that there is a texture leak in the marker layer.

For your use-case I would recommend to write an optimized marker layer that uses a texture atlas to be able to batch the drawing of multiple marker. Or better: make a dynamic layout-layer with leaders to avoid overlaps :)