Update the location it tries to put the infoblock if it's over the icon

This commit is contained in:
James Wilson 2017-02-06 12:23:21 -06:00
parent 2e6b4eb4b6
commit d40e69ee42

View file

@ -1383,6 +1383,7 @@ function adjustSelectedInfoBlockPosition() {
} else { } else {
infoBox.css("left", infoBoxOriginalPosition.left); infoBox.css("left", infoBoxOriginalPosition.left);
infoBox.css("top", infoBoxOriginalPosition.top); infoBox.css("top", infoBoxOriginalPosition.top);
infoBoxPosition = infoBox.position();
} }
var infoBoxExtent = getExtent(infoBoxPosition.left, infoBoxPosition.top, infoBox.outerWidth(), infoBox.outerHeight()); var infoBoxExtent = getExtent(infoBoxPosition.left, infoBoxPosition.top, infoBox.outerWidth(), infoBox.outerHeight());
@ -1394,8 +1395,8 @@ function adjustSelectedInfoBlockPosition() {
if (isPointInsideExtent(markerPosition[0], markerPosition[1], infoBoxExtent)) { if (isPointInsideExtent(markerPosition[0], markerPosition[1], infoBoxExtent)) {
// Array of possible new positions for info box // Array of possible new positions for info box
var candidatePositions = []; var candidatePositions = [];
candidatePositions.push( { x: 20, y: 20 } ); candidatePositions.push( { x: 40, y: 60 } );
candidatePositions.push( { x: 20, y: markerPosition[1] + 40 } ); candidatePositions.push( { x: 40, y: markerPosition[1] + 80 } );
// Find new position // Find new position
for (var i = 0; i < candidatePositions.length; i++) { for (var i = 0; i < candidatePositions.length; i++) {