none
Clustering of HTML Pushpin RRS feed

  • Question

  • Hello !

    I know the Bing Maps V8 already contain a clustering module and that pushpins are rendered in a canvas.

    But there's a example of HTML Pushpin with Custom Overlay.

    With my team we manage to merge this sample with the clustering module, but I think it's a little crappy.

    No information on pushpin parent or cluster direct children (like another cluster, just info on final children).

    Could you provide more information on a ClusterPushpin and on the lifecycle and keep the same instance for a same cluster (for the same cluster, if I zoom in and zoom out, it's not the same instance) ?

    It would suck to construct or own Clustering HTML Pushpin.

    By the way, what's the reason for always rendering Pushpins on canvas ?

    Sunday, May 14, 2017 12:08 AM

Answers

  • The only option at this time is to modify the V7 clustering module to work with the HTML Pushpin layer. Note that you really should just move away from HTML pushpins. You are severely limiting the amount of data your application will be able to handle. SVG's, images, even generating an image using an off screen canvas would be better.

    [Blog] [twitter] [LinkedIn]

    Monday, May 15, 2017 4:03 PM
  • V7 barely supported 1,000 pushpins and a few hundred polylines/polygons. V8 supports tens of thousands of shapes. Why are you updating the positions every 50ms, that is a bit excessive and is what you would do for animations which are no supported in v8.

    if you need html elements then see my last suggestion around using the v7 clustering module which is open source and the html pushpin layer sample.


    [Blog] [twitter] [LinkedIn]

    Thursday, June 22, 2017 3:54 AM

All replies

  • > HTML Pushpin...we manage to merge this sample with the clustering module

    Oh my god can you share how you did this??

    We need html pushpins but also clustering of said pushpins, and we could not figure out how to accomplish this. It used to be so easy in V7.


    • Edited by Posef Monday, May 15, 2017 3:27 PM
    Monday, May 15, 2017 3:26 PM
  • The only option at this time is to modify the V7 clustering module to work with the HTML Pushpin layer. Note that you really should just move away from HTML pushpins. You are severely limiting the amount of data your application will be able to handle. SVG's, images, even generating an image using an off screen canvas would be better.

    [Blog] [twitter] [LinkedIn]

    Monday, May 15, 2017 4:03 PM
  • Hi Ricky ,

    Thanks for your answer on another post.

    Our team requires selenium(automation) test which will require id field on html element , however , we don't have a reliable to do it in canvas (since there is no indicator for selenium to locate the element)

    Another reason for us to use the html is performance is worse when we have both a normal layer and cluster layer on the map. we have about 300 clustered pushpins and 100 other pushpins in another non-cluster layer. we are moving the pushpins each 50ms using setTimeout(), It can be reproduced in interactive SDK. It was not an issue in v7.

    Please let me know if you need an example on the performance issue.So I can provide one.

    I have not seen performance improvement with v8 , however seen some decrease instead ,not sure how the performance is measured between the 2 versions.

    Another issue is , if the normal(non-cluster) pushpin is not currently located on the screen right now , when you move the mouse to re-center the pushpin , the pushpin won't show until the mouse is released . And the polygon will appear without this issue. when pushpin and polygon are supposed to comming together , it is weird.

    Looking forward for your reply.

    Thanks,

    Di 









    • Edited by diying Wednesday, June 21, 2017 11:58 PM
    Wednesday, June 21, 2017 11:46 PM
  • V7 barely supported 1,000 pushpins and a few hundred polylines/polygons. V8 supports tens of thousands of shapes. Why are you updating the positions every 50ms, that is a bit excessive and is what you would do for animations which are no supported in v8.

    if you need html elements then see my last suggestion around using the v7 clustering module which is open source and the html pushpin layer sample.


    [Blog] [twitter] [LinkedIn]

    Thursday, June 22, 2017 3:54 AM
  • We did that with 3 layers.

        1) underlying cluster layer

        2) one pushpin layer for html pushpin

        3) one pushpin layer for clustered html pushpin

    the underlying cluster pushpin layer contains option {visible:false} so it will be invisible.

    when push a new pushpin , create both html pushpin and canvas pushpin, 

    cluster layer has 2 callback function : 1) when a cluster pushpin is created , 2) when all the cluster pushpins are created 

    1) in the function , create a html pushpin for cluster and also set the canvas cluster pushpin to invisible

    2) when all the cluster pushpins are created set html pushpin(non-cluster) to invisble if it is in the cluster(it is not supposed  to be seen) 

    There are other steps but this is the main idea.



    • Edited by diying Monday, July 17, 2017 6:12 PM
    Monday, July 17, 2017 6:12 PM