I have a Polyline like the one shown in the example, representing the path of a vehicle. GeoJSON markers show the vehicle's position over time.

How can I reduce the density of the markers when the user zooms out?

enter image description here

Example with Polyline Decorator

  • 1
    Can you please clarify what should happen to the markers when the user zooms in? What should happen when the user zooms out? – Stephen Lead Sep 4 '17 at 23:05
  • As the user zooms in, the hidden markers are displayed and as he moves away he is hiding only a part of them so that the Polyline does not look as over loaded. The idea is to make a kind of cluster. – Chap2 Sep 4 '17 at 23:32
  • Have you looked at the Leaflet marker cluster functionality? If so, what needs to be different than using that library? – Stephen Lead Sep 5 '17 at 4:00
  • I have seen some examples but the examples are oriented grouping the markers and I really need to not group them rather hide it. ejemplo The image shows 3 zoom levels 12, 14, 16 as an example. – Chap2 Sep 5 '17 at 4:04
  • the example link isn't working for me. Can you edit the question and include the 3 images directly in the Stack Exchange question? – Stephen Lead Sep 5 '17 at 4:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.