Fix incorrect info box size calculation
This commit is contained in:
parent
ffd661be84
commit
cd8b48c282
|
@ -1201,7 +1201,7 @@ function adjustSelectedInfoBlockPosition() {
|
||||||
// Get info box position and size
|
// Get info box position and size
|
||||||
var infoBox = $('#selected_infoblock');
|
var infoBox = $('#selected_infoblock');
|
||||||
var infoBoxPosition = infoBox.position();
|
var infoBoxPosition = infoBox.position();
|
||||||
var infoBoxExtent = getExtent(infoBoxPosition.left, infoBoxPosition.top, infoBox.width(), infoBox.height());
|
var infoBoxExtent = getExtent(infoBoxPosition.left, infoBoxPosition.top, infoBox.outerWidth(), infoBox.outerHeight());
|
||||||
|
|
||||||
// Get map size
|
// Get map size
|
||||||
var mapCanvas = $('#map_canvas');
|
var mapCanvas = $('#map_canvas');
|
||||||
|
@ -1217,7 +1217,7 @@ function adjustSelectedInfoBlockPosition() {
|
||||||
// Find new position
|
// Find new position
|
||||||
for (var i = 0; i < candidatePositions.length; i++) {
|
for (var i = 0; i < candidatePositions.length; i++) {
|
||||||
var candidatePosition = candidatePositions[i];
|
var candidatePosition = candidatePositions[i];
|
||||||
var candidateExtent = getExtent(candidatePosition.x, candidatePosition.y, infoBox.width(), infoBox.height());
|
var candidateExtent = getExtent(candidatePosition.x, candidatePosition.y, infoBox.outerWidth(), infoBox.outerHeight());
|
||||||
|
|
||||||
if (!isPointInsideExtent(markerPosition[0], markerPosition[1], candidateExtent) && isPointInsideExtent(candidatePosition.x, candidatePosition.y, mapExtent)) {
|
if (!isPointInsideExtent(markerPosition[0], markerPosition[1], candidateExtent) && isPointInsideExtent(candidatePosition.x, candidatePosition.y, mapExtent)) {
|
||||||
// Found a new position that doesn't overlap marker - move box to that position
|
// Found a new position that doesn't overlap marker - move box to that position
|
||||||
|
|
Loading…
Reference in a new issue