[VTM] Dont show VectorLayer on lower zooms

46 views
Skip to first unread message

Pablo Nicitel

unread,
Jun 10, 2020, 4:15:22 AM6/10/20
to Mapsforge & VTM
Hi,

I have around 1000+ vector layers. One circle in each layer. If the zoom is high, so I see only several circles, everything is OK. If the zoom is low, so all circles/layers are shown on the map, the app starts to freeze. 
Is there a way how to prevent the drawing of VectorLayer on lower zooms? 

I remove all vector layers when user touches the map in lower zoom, but problem is if user touches the map in high zoom and changes the zoom by more levels. In that case all vector layers are drawn in lower zooms because I registered the touch on high zoom only.

Is there a way how to prevent the drawing of VectorLayer on lower zooms directly or is there any zoom listener? So I could identify low zoom while user is still zooming?

thank you

Emux

unread,
Jun 10, 2020, 4:24:29 AM6/10/20
to mapsfo...@googlegroups.com
Can remove / add the layers or use the Layer.setEnabled when zoom changes.

Can listen map position changes with Map.UpdateListener.
(search the repository for examples of its usage)

--
Emux

Pablo Nicitel

unread,
Jun 10, 2020, 5:45:28 PM6/10/20
to Mapsforge & VTM
Thank you. Works.

Dňa streda, 10. júna 2020 10:24:29 UTC+2 Emux napísal(a):
Reply all
Reply to author
Forward
0 new messages