About AjaxMapControl zoon in/out js errors

Topics: General Topics, SharpMap v0.9 / v1.x, Web Controls
Feb 24, 2009 at 2:46 PM
When I run the project in the vs2008 environment, it run perfect.
But when I deploy to a virtual machine and access the web page in my destop,error showed to me.

the js error is "object required",so  I think weather it is because of some objects didn't load completely in time .
So when the js function invoke it,it was half-baked.
But how can I control this situation? And why it didn't show in the VS2008 development environment?

if you need any code to find some clues ,tell me.
thank you

Feb 24, 2009 at 3:16 PM
When I trace the js code ,I found the error was from ViewChanged function.
In this function I invoke another function like this "SharpMap_GetRelativePosition(event.clientX,event.clientY,obj.container)",I found the event.clientX was null sometimes.
so I got the "object required" error.
Feb 24, 2009 at 3:22 PM
Now I konw the event.clientX is only  supported by IE 6, so that's why I can run it  in my development envirment.
But how can I fix it? the SharpMap_GetRelativePosition function need a couple of integers as parameters.
Feb 24, 2009 at 3:46 PM
Something wrong~ IE7 supported the window.event too.
But I often lost the window.event.When I lost it ,it will be null.
When I clicked the map,it lost sometimes.By the way,if I stay in the page longer, it will be work pretty good(no lost).
So ,I want to konw can I control the window.event and fire it by myself?
Feb 24, 2009 at 4:50 PM
Hi athel, I dont know the exact reason for your issue, but a common problem is with incorrect  absolute paths (to scripts or resources). Make sure there arent any links such as localhost - these will work fine on your local development machine but will not work when the project is in a remote location. hth jd
Feb 24, 2009 at 5:01 PM

I make the js script inside of the page.so no path problem.