Bing Maps with pins and cluster loses click handler and has poor performance

I have a Bing map with pins and clusters.

I noticed performance issues and bugs in this combination. I installed the demo using code from the official docs .

1st issue: click handler is no longer available after zooming

Steps to reproduce:

  • Download the above demo
  • Hover over one pink contact => its clickable (cursor is hand / pointer)
  • Press the + button to zoom in
  • Some of the individual pink contacts are no longer clickable (default cursor)

Second problem: really bad performance when initializing the card

It looks like it's caused by many, many calls _initiateRequest

, _setImage

or downloadImage

in JavaScript Bing Maps. See this performance captured with the Firefox Performance tool:

enter image description here

This performance metric drops to about half if the parameter is not passed icon

, i.e. in the demo this is commented out so that only the default Bing Maps icons are used:

cluster.setOptions({
  // commenting this out improves performance
  // icon: svg.join(''),
  anchor: new Microsoft.Maps.Point(radius, radius),
  textOffset: new Microsoft.Maps.Point(0, radius - 8)
});

      

NB in ​​the demo only the cluster has a configurable parameter icon

. Performance gets much, much worse if all pins get a configurable parameter as well icon

. It doesn't matter if the icon is SVG or PNG, both are very bad, and Bing Maps seems to fire DOM events and older browsers like IE11 even hang for a few seconds.

+3


source to share


1 answer


Try using the experimental branch. It has added many updates to address these issues. You can try adding "& branch = experimental" to the map script url. The main release branch will be updated with updates in the experimental branch in the next 2 weeks.



+2


source







All Articles