[mapguide-users] OnMapLoaded

Pascal Coulon pascal.coulon at atkinsglobal.com
Wed Nov 14 07:37:39 EST 2007


Hi,

You could use the Microsoft AJAX framework. here is bit of code:

#################
client side code
#################

<iframe height="100%" width="100%" id="_Map"
src="../mapguide/mapviewernet/ajaxviewer.aspx?SESSION=<%= m_sessionId
%>&WEBLAYOUT=<%= m_webLayout %>">
</iframe>
<asp:ScriptManager ID="TheScriptManager" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel Visible="false" ID="UpdatePanelRefresh" runat="server"
UpdateMode="conditional">
    <Triggers>
        <asp:AsyncPostBackTrigger ControlID="TimerRefreshMap"
EventName="Tick" />
    </Triggers>
</asp:UpdatePanel>
<asp:Timer ID="TimerRefreshMap" runat="server" OnTick="AutomaticRefreshMap">
</asp:Timer>

###############
Server side code
###############
Protected Sub AutomaticRefreshMap(ByVal sender As Object, ByVal e As
System.EventArgs) Handles TimerRefreshMap.Tick

            'Refresh the map using the viewer api
            Try
                If Session("RefreshLiveData") = True Then

                    Dim strScript As String
                    'Call any API function required
                    strScript = "_Map.mapFrame.Refresh();"
                    ScriptManager.RegisterStartupScript(Page, Page.GetType,
"refresh", strScript, True)

                End If
            Catch ex As Exception
                Session("RefreshLiveData") = True
            End Try

        End Sub



-- 
View this message in context: http://www.nabble.com/OnMapLoaded-tf4804147s16610.html#a13745967
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list