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.?