The Vwa.VwaPage.getPosition function returns the same value regardless of the position of the page in the viewport

Symptoms

When you use the Vwa.VwaPage.getPosition function in JavaScript to return the position of a page in Microsoft SharePoint Server 2010, Vwa.VwaPage.getPosition returns the same value regardless of the position of the page in the view port. The function always returns the following value:

(-viewSize.width/2, -viewSize.height/2)

Workaround

Programmers can work around this issue by accessing internal objects to calculate the expected result. For example, programmers can use code that resembles the following:

var viewPosition = vwa._control._renderingArea.getViewPosition();
var viewSize = vwa._control._renderingArea.getViewSize();
var pagePosition = {};
pagePosition.x = viewPosition.x - Math.ceil(viewSize.width / 2);
pagePosition.y = viewPosition.y - Math.ceil(viewSize.height / 2);

More Information

Microsoft has confirmed that this is an issue in the Visio Services API.

For more information, visit the following Microsoft Developer Network (MSDN) website:
Properties

Article ID: 2414992 - Last Review: Feb 12, 2011 - Revision: 1

Feedback