setting currentScale, currentTranslate.x, currentTranslate.y

D

denis_browne

I am trying to zoom and pan to an area on a map from a web page.
I do this by setting currentScale, currentTranslate.x and
currentTranslate.y.
But I get unreliable results. The map may get positioned correctly,
or it may go to some other location.

So I wrote a snippet which is suppose to reset currentTranslate.x
again:

The code:

svgDoc.currentScale = 1;
svgDoc.currentTranslate.setX(0);
svgDoc.currentTranslate.setY(0);

while (svgDoc.currentTranslate.x != 0) {
svgDoc.currentTranslate.x = 0;
alert(svgDoc.currentTranslate.x);
};

But it just gets stuck in infinite loop like it cant change the value
of currentTranslate.x.
Why is it happening?

Do you know how to change currentTranslate.x?

Thanks, Ron
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,999
Messages
2,570,246
Members
46,843
Latest member
WizcraftEntertainmentAgen

Latest Threads

Top