[mapguide-users] Select features on map load

sathishpsk9 sathishpsk9 at gmail.com
Thu Jul 2 05:42:37 EDT 2009




Hi  Paulo Veríssimo

 Ya .you can do that in a button click ... Please check 'Adding an initial
layer ' sample code in mapguide site 
I suggest following step 
1.You should your url should be of type 

../mapviewernet/ajaxviewer.aspx?SESSION=<%=Session("sid")%>&WEBLAYOUT=<%=Session("layout")
where you can have following code in onload method of that page 

 Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
        Try
            Dim sessionId, th, tempid As String
            Dim realPath As String =
Request.ServerVariables("APPL_PHYSICAL_PATH")
            Dim configPath As String = realPath + "..\\webconfig.ini"
            MapGuideApi.MgInitializeWebTier(configPath)
            Dim userInfo As MgUserInformation = New
MgUserInformation("Administrator", "admin")
            Dim site As MgSite = New MgSite()
            site.Open(userInfo)
            sessionId = site.CreateSession()
            Dim host As Uri = New
Uri("http://localhost/mapguide/mapagent/mapagent.fcgi")
            Dim conn As HttpServerConnection = New
HttpServerConnection(host, "Administrator", "admin", "en", True)
            Dim layout As WebLayout
            layout =
conn.GetWebLayout("Library://somefolder/somelayout.WebLayout")
            'layout.TaskPane.InitialTask = "../some.aspx"
            th = New ResourceIdentifier("gg", ResourceTypes.WebLayout,
sessionId)
            conn.SaveResourceAs(layout, th)
            tempid = th
            HttpContext.Current.Session("sid") = sessionId
            HttpContext.Current.Session("layout") = th

        Catch ex As Exception

        End Try
    End Sub 

Thanks & Regards
Satish
-- 
View this message in context: http://n2.nabble.com/Select-features-on-map-load-tp3174763p3194223.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list