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