SetOnClickListener

(TButton.SetOnClickListener Method)

Registers an event handler for mouse-click event on the button. The argument-callbackFunction is a function, which would be called when the user defined button is clicked with the mouse. You should implement the callbackFunction.
public SetOnClickListener(callbackFunction):Void

Parameters

  • callback Function : Functor Object - This function will be called when the polygon is clicked with the mouse. It is an event handler for mouse-click event on the button.You should implement the callbackFunction.
  • Returns

  • Void
  • Example

    The following example shows how to registe an event handler for mouse-click event.Functor onClick_marker0 will be called when the button is clicked with the mouse.
    
    <div id="mapContainer"  style="width: 640px; height: 400px;"></div>
    <script type="text/javascript">
        var map0 = new TMap(mapContainer, 25.7590256665386, -80.3738769902151, 15, mapLoaded, 1, true, "", "hybrid");
    
       
        function mapLoaded() {
            var button=map0.AddCustomizedButton(24, 8,"images/example_15/button.png");
            button.SetOnClickListener(onClick_button);
            
        function onClick_button() {
        map0.ShowInfoWindow(25.7590256665386, -80.3738769902151,
                                    "border=normal;width=200;height=100",
                                    "Info Window without Tabs",
                                    "This is a Simple info window");
    
        }