Problem while convrting mappoint in to screenpoint using Arcgis Javascript API

Discussion created by harshanand.wankhede on Jun 9, 2013
Latest reply on Jun 9, 2013 by vinaybansal
0 down vote favorite

I am getting very strange problem when converting from Map point to screenpoint.

I am using following code.

var sp = esri.geometry.ScreenPoint(512, 151); mp = map.toMap(sp);

When we convert from ScreenPoint(512, 151) to Mappoint, I am getting following map coordinate. 338638.7275175141, 4404774.250335829

Now when I perform reverse conversion, i.e from same above Mappoint(338638.7275175141, 4404774.250335829) to ScreenPoint, I am getting very different screenpoints.i.e. (31563417740, -72455974). I guess now again I should get same screenpoint(512, 151). For this reverse conversion I am using following code. mp1 = new esri.geometry.Point(338638.7275175141, 4404774.250335829); sp1 = map.toScreen(mp1);

What I am getting very different screenpoint not (512,151)