Hello all,

I signed up to ask this question: Does CenterAt work? And if so, what am I doing wrong?

I've created a simple function to move to some coordinates:

However, only the setLevel seems to happen. I am never centered to the new results.

Any help would be appreciated!

Thanks.

I signed up to ask this question: Does CenterAt work? And if so, what am I doing wrong?

I've created a simple function to move to some coordinates:

this.goto = function () { var coordinates = prompt("Enter coordinates: ", "502982,221818").split(","); if (coordinates.length != 2) { return; } var point = new esri.geometry.Point({ "x": coordinates[0], "y": coordinates[1], " spatialReference": { " wkid": 27700} }); self.map.centerAt(point); self.map.setLevel(10); }

However, only the setLevel seems to happen. I am never centered to the new results.

Any help would be appreciated!

Thanks.

I swapped to using self.map.spacialReference instead of creating a new one, but this has not helped.

However, I tried carrying out similar commands in the console, and for some reason it works:

I was a bit suspicious, so I removed the line that setLevel(10), and now my original code works.

Swaping around the commands, so setLevel THEN centerAt, seems to work. However my original, centerAt THEN setLevel seems to override the centerAt command.

Thanks for your help!