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.
Bingmap infobox hiding on overflow
Surya
6
Reputation points
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.
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.?
1 answer
Sort by: Most helpful
-
rbrundritt 15,211 Reputation points Microsoft Employee
2022-11-29T16:50:24.567+00:00