none
Hide/show pushpin/cluster in Client Side Clustering V7 RRS feed

  • Question

  • Hi,

    We have requirement to hide/show pushpin/cluster based on some condition. Is it possible to hide/show pushpin/clustering in v7.

    Thanks!

    Balasaheb



    Balasaheb

    Monday, April 25, 2016 2:09 PM

Answers

  • If you simply want to hide/show a pushpin, use the visible property in the pushpin options. If you want to remove a pushpin so that it is not included in clustering, you need to remove it from the clustering data set.


    [Blog] [twitter] [LinkedIn]

    Monday, April 25, 2016 8:16 PM
  • That's why you have to remove the pushpins that you don't want to show from the clustering. Don't just hide them, put remove them from the clustering layers list of pushpins. Otherwise the next time you move the map it will rerender and show your pins again. Visibility property is ignored on pushpins in clusters as that would require additional checks in the code and slow it down which is the opposite purpose of the clustering layer.

    [Blog] [twitter] [LinkedIn]

    Tuesday, April 26, 2016 3:06 PM

All replies

  • If you simply want to hide/show a pushpin, use the visible property in the pushpin options. If you want to remove a pushpin so that it is not included in clustering, you need to remove it from the clustering data set.


    [Blog] [twitter] [LinkedIn]

    Monday, April 25, 2016 8:16 PM
  • Hi Ricky,

    Thanks for your reply. We are able to hide/show pushpin but we have below issue.

    After hideing the pushpins when we change the view then all pushpins start showing. To resolve this issue we have use some logic to hide/show pushpin on "viewchangeend" event of map but it did not work all the time. Can you have better solution to resolve this issue.

    Thanks!

    Balasaheb


    Balasaheb

    Tuesday, April 26, 2016 1:06 PM
  • That's why you have to remove the pushpins that you don't want to show from the clustering. Don't just hide them, put remove them from the clustering layers list of pushpins. Otherwise the next time you move the map it will rerender and show your pins again. Visibility property is ignored on pushpins in clusters as that would require additional checks in the code and slow it down which is the opposite purpose of the clustering layer.

    [Blog] [twitter] [LinkedIn]

    Tuesday, April 26, 2016 3:06 PM