How to disable click event on ajaxMap

Topics: SharpMap v0.9 / v1.x, Web Controls
Sep 7, 2009 at 6:07 PM

Hi all

I have just started to work on sharpMap.

I want to disable click event on ajaxmap.

I have used following lines but it did not work.

 

<smap:AjaxMapControl width="400px" height="600px" id="ajaxMap" runat="server"
onClick="ctl00_MainContent_ajaxMapObj.toogleClickEvent();ctl00_MainContent_ajaxMapObj.setClickEvent(mymethod);" OnViewChange="ViewChanged" 
        OnViewChanging="ViewChanging" style="text-align: center" BackColor="White" 
             BorderColor="Black" BorderStyle="Solid" >
             </smap:AjaxMapControl>

<smap:AjaxMapControl width="400px" height="600px" id="ajaxMap" runat="server"

onClick="ctl00_MainContent_ajaxMapObj.toogleClickEvent();ctl00_MainContent_ajaxMapObj.setClickEvent(mymethod);" OnViewChange="ViewChanged" 

        OnViewChanging="ViewChanging" style="text-align: center" BackColor="White" 

             BorderColor="Black" BorderStyle="Solid" >

             </smap:AjaxMapControl>

 

 

 

Sep 8, 2009 at 5:26 PM

ctl00_MainContent_ajaxMapObj.disableClickEvent()

ctl00_MainContent_ajaxMapObj.enableClickEvent()

Those are the two methods used to enable/disable click events.

Sep 24, 2015 at 8:26 PM
when i toggle between the zoom in/out and query radio buttons, i am getting the following error in firebug. can someone please tell me how to make this work.

ReferenceError: ctl00_MainContent_ajaxMapObj is not defined
Sep 24, 2015 at 8:43 PM
Edited Sep 24, 2015 at 8:44 PM
I have tried to change the inline code blocks but still the id dosent change

<div style="background-color: #fff; color:#000;">
    <asp:RadioButtonList ID="rblMapTools" runat="server" RepeatDirection="Horizontal">
        <asp:ListItem Value="0" onClick="<%=ajaxMap.ClientID%>.disableClickEvent(); <%=ajaxMap.ClientID%>.zoomAmount = 3;"  Selected="True">Zoom in</asp:ListItem>
        <asp:ListItem Value="1" onClick="<%=ajaxMap.ClientID%>.disableClickEvent(); <%=ajaxMap.ClientID%>.zoomAmount = 0.33333;" >Zoom out</asp:ListItem>
        <asp:ListItem Value="2" onClick="<%=ajaxMap.ClientID%>.enableClickEvent();">Query map</asp:ListItem>
    </asp:RadioButtonList>
</div>
<div style="background-color:#f1f1f1; border:solid 1px #000;">
    <smap:AjaxMapControl width="100%" height="400px" id="ajaxMap" runat="server"
    OnClickEvent="MapClicked" OnViewChange="ViewChanged" OnViewChanging="ViewChanging" />
</div>