map.extent gives back NaN values

678
2
06-25-2014 11:32 AM
ChristianTrummer
New Contributor
hello

i am working on a bug for some weeks now. when i call map.extent to get xmin, xmax, ymin and ymax sometimes i get NaN values for one or two of the values in the extent. i am not able to reproduce this behaviour! does anybody had the same isse? sometimes i get four NaN values but most of the times i get one or two NaN values. if i call map.extent like 20 times i get the error once.

infos to the application: arcgis is integrated into a jquerymobile webapp which is of course using jquery. some actions open a jquerymobile page which overlays the arcgis map. after some actions on this page it hides and the map shows up again. after that map.extent is called and some ajax requests. i think it has something todo with the overlaying jquerymobile page.

some devs mentioned to turn of the autoResize option, which i did. it got better but it happens nevertheless.

thx for the help
regards
chris
0 Kudos
2 Replies
KenBuja
MVP Esteemed Contributor
Have you tried putting that call into the map resize (or reposition) handler? It could be that the map isn't "ready" yet when it becomes visible again by the time you ask for its extents.
0 Kudos
ChristianTrummer
New Contributor
i could try it but this will get very complicated then. i am also not sure if the resize/reposition events gets called because nothing changes in the map in the meantime. theres just a div overlay for some seconds.
0 Kudos