ThinkGeo.com    |     Documentation    |     Premium Support

Javascript Click Event on Shape



What is the best way to trigger a click event on a user's drawed shape (client-side) and and allow the user to input label description. Example, user draw a rectangle and then click on the rectangle to add text description. Ideally, I would like to do all on the client-side without postback. Please advise.


Thanks in advance



Mark,


Here is a sample for you which shows how to raise a client-click event on a user's drawed shape. Any queries please let me know.


Notes: The sample is based on the latest Web Edition (3.1.0) released early today.


Ben.


 


 



315-Post5128.zip (7.62 KB)

When I run your project, I am getting "Object not supported…" for Map1.SetEditSetting(0);.

Nevermind the above, I install the latest version and it work. However, how can I make the popup message transparent.  
  
 In addition, by installing the latest version, I notice the mouse-click event is causing the map to zoomin. Is there any way I can disable the mouse’s events for zooming altogether (Ex. Mouse click and mousewheel. Thanks for your assistance. Your help is appreciated

The following code could disable mouse wheel to zoom in, but we can’t recreate click to zoom in, what you mean “click” is double click or single click? 
  
 Map1.MapTools.MouseMapTool.IsMouseWheelDisabled = true; 


That is the method I am using to disable it, however,  whenever I scroll the wheel up and down my project always break on this line of code (opl_Georesource.axd[dynamic] file).


"This.element.scrolls[1]=(document.documentElement.scrollTop||document.body.scrollTop);}" 




 Mark, 
  
 We couldn’t recreate your issue, could you provide more information about that? Also, please have a look at the sample (along with our product) “/Samples/NavigateTheMap/PanTheMap.aspx” which uses this API and let us know if you get the same problem there.  
  
 Thanks, 
  
 Ben