ThinkGeo.com    |     Documentation    |     Premium Support

How to override the client side Mousemove/DbClicked (javascript) events in Web 3.0?

In one of my 2.5 apps I wrote Mousemove, DbClicked events to override the

BuiltIn events. (A tip shows up when a user moves the cursor into a dot on

the map. A new browser window pops up when a user double-clicks on a dot on

the map)  (The following javascript functions on CAESARMap.aspx)

function TheMouseMove(e)

{

      Init(e);

      if (done == true)

      {

          return;

      }

      var CX = e.offsetX - 0;

      var CY = e.offsetY - 0;



........

                      {

                            _lngX = e.offsetX;

                            _lngY = e.offsetY;



                          if ( _TimerEnabled == false )

                          {

                                _TimerEnabled = true;

                                HideToolTips();

                                intervalID = setTimeout("ShowToolTips()",

500);



                                _lngLastX = e.offsetX;

                                _lngLastY = e.offsetY;

                          }

                          else

                          {

                                if (_lngX != _lngLastX || _lngY !=

_lngLastY)

                                {

                                    HideToolTips();

                                    _TimerEnabled = false;

                                }

                          }

                      }

                      break;

      ..............................

}



function TheMouseDoubleClick(e)

{

      var ComplaintID;

      var strCAESARUrl1;

      done = false;

      Init(e);



      var hdnCAESARUrl = document.getElementById("hdnCAESARUrl");

      switch (HiddenTextbox.mode)

      {

              case 'TrackRectangle':

                    //alert(HiddenTextbox.mode);

                  ComplaintID = GetComplaintNum(e.offsetX, e.offsetY);

                  if (ComplaintID != '0')

                {

                  strCAESARUrl1 = hdnCAESARUrl.value + ComplaintID;

                  window.open(strCAESARUrl1, "CAESAR", "width="

+screen.width + ",height=" +screen.height +

",top=0,left=0,location=1,menubar=1,resizable=1,scrollbars=1,status=1,toolbar=1"

);

                }

                      break;

......................................

}



 



Kevin,


   In WebEdition 3.1.0, you can override the JavaScript “mousemove” event by registering it to the map and hook up “DoubleClick” event by setting Map's “OnClientDoubleClick” property. Please see the attached sample for more information.


Thanks,


Ben



320-Post5144.zip (8.17 KB)