Hello ,
I am trying to create a session and open a Map.
At the same time I need to get the MgMap object of the Map I just opened.
Since I have the MapGuide URL I am going to redirect my response.
But at the same time I need the MgMap object.
Any thoughts please ?
Thanks
Anand
Here is my code
Session["SiteID"] = "221";
string MapGuideGISINI = ConfigurationManager.AppSettings["MapGuideGISINI"].ToString();
MapGuideApi.MgInitializeWebTier(MapGuideGISINI);
MgUserInformation userInfo = new MgUserInformation("Anonymous", "");
MgSiteConnection TheMgSiteConnection = new MgSiteConnection();
TheMgSiteConnection.Open(userInfo);
MgSite site = TheMgSiteConnection.GetSite();
string sessionId = site.CreateSession();
userInfo.SetMgSessionId(sessionId);
string WebLayoutResourceString = "Library://" + Session["SiteID"].ToString() + "/Layouts/" + Session["SiteID"].ToString() + ".WebLayout";
string MapGuideGISURL = ConfigurationManager.AppSettings["MapGuideGISURL"].ToString();
string ajaxsrc = MapGuideGISURL + "?SESSION=" + sessionId + "&WEBLAYOUT=" + WebLayoutResourceString + "&LOCALE=en";
Response.Redirect(Response, ajaxsrc, "GIS", "resizable=yes,toolbar=no,location=no,width=580,height=525,directories=no,status=no,scroll=yes,scrollbars=yes,menubar=no,left=10,top=10");