Bingmap infobox hiding on overflow

Surya 6 Reputation points
2022-11-29T06:25:47.513+00:00

I tried infobox sample to display the tooltip on hovering the polygons. But the tooltip is hiding when we hover the region on the edge as we can see in the second image.

265073-image.png

264890-image.png

Code Snippet:

infobox = new Microsoft.Maps.Infobox(center, {  
            title: 'Map Center',  
            description: 'This is the center of the map.',  
            showPointer: false,   
            showCloseButton: false,  
 visible: false,  
            actions: [{  
                label: 'Handler1',  
                eventHandler: function () {  
                    alert('Handler1');  
                }  
            }, {  
                label: 'Handler2',  
                eventHandler: function () {  
                    alert('Handler2');  
                }  
            }]  
        });  

function showTooltip(e) {  
//polygon hover event  
 if (e.target.metadata) {  
           
            infobox.setOptions({  
                location: e.location,  
                title: e.target.metadata.title,  
                description: e.target.metadata.description,  
                visible: true  
            });  
        }  
  
 }  

Do we have any option to adjust the tooltip position dynamically.?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
660 questions
Windows Maps
Windows Maps
A Microsoft app that provides voice navigation and turn-by-turn driving, transit, and walking directions.
253 questions
{count} votes

1 answer

Sort by: Most helpful
  1. rbrundritt 16,461 Reputation points Microsoft Employee
    2022-11-29T16:50:24.567+00:00

    The Bing Maps control does not reposition the infobox to keep it in view, it anchors on a consistent point on the infobox as defined by you. Azure Maps however does support allowing the infobox to automatically reposition itself to stay within the map view.

    0 comments No comments