locked
event rightclick not working RRS feed

  • Question

  • I have the following code that works fine....

                           var ETASummaryinfobox = new Microsoft.Maps.Infobox(Corridorcenter, {
                               htmlContent: ETAInfoboxhtml
                           });
    
                           map.entities.push(ETASummaryinfobox);
    
                           ETASummaryinfobox.setOptions({ offset: new Microsoft.Maps.Point(3, 10), visible: false });
    
                           Microsoft.Maps.Events.addHandler(StormSummaryETApushpinLoc, 'click', function () {
                            ETASummaryinfobox.setOptions({ visible: true, autoAlignment: true });
                           });

    when I change 'click' to 'rightclick' it no longer works.

    when I change it to 'dblclick' it works....

    What is causing this behavior?

    Tuesday, February 26, 2019 6:47 PM

Answers

  • came across this documentation. Answer is you can't use rightclick in this context. A workaround is found here:

    https://docs.microsoft.com/en-us/bingmaps/v8-web-control/map-control-concepts/event-examples/right-click-events-for-shapes

    • Marked as answer by DDL19 Tuesday, February 26, 2019 10:48 PM
    Tuesday, February 26, 2019 10:48 PM