[mapguide-users] Map fails to initialize about 25% of the time

tmblackflag steve.calpoly at gmail.com
Wed Oct 26 19:18:47 EDT 2011


Hello,

Using MGE 2012 w/ Studio, ASP.NET C#.

About 25% of the time the map frame loads but the map itself fails to
initialize. I've checked my ACCESS logs and every time, including load
failures i can see the server successfully getting the maps and all feature
sources. The developer guide mentions an issue with users clicking on the
task frame before map initializes but that doesn't seem to apply here. Here
is the page which loads connects to the server, loads the web layout and
dynamically changes the map, then updates some HTML on the client side to
render the map. (I've cut code out but i do this to create multiple map
frames for same-time use. For these testing purposes i only ever use one
frame).

Any ideas?

public partial class mainFrame : System.Web.UI.Page
{
    public string count;
    public string floor1;
    public string sessionId;
    static string s_basePath;
    public string defaultUser = "Administrator";
    public string defaultPassword = "admin";
    public string webLayout = "Library://Layouts/Web Layout.WebLayout";

    protected void Page_Load(object sender, EventArgs e)
    {
        count = Request.QueryString["COUNT"];
        floor1 = Request.QueryString["FLOOR1"];

        InitializeWebTier();
        MgUserInformation userInfo = new MgUserInformation(defaultUser,
defaultPassword);
        MgSiteConnection siteConnection = new MgSiteConnection();
        siteConnection.Open(userInfo);
        MgSite site = siteConnection.GetSite();
        sessionId = site.CreateSession();

        MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;
        MgByteReader rd = resourceService.GetResourceContent(new
MgResourceIdentifier("Library://LAYOUTS/Web Layout.WebLayout"));
        XmlDocument doc = new XmlDocument();
        doc.PreserveWhitespace = true;
        doc.LoadXml(rd.ToString());
        doc.GetElementsByTagName("ResourceId").Item(0).InnerText =
"Library://MAPS/Map.MapDefinition";
        MgResourceIdentifier newLayout = new MgResourceIdentifier("Session:"
+ sessionId + "//basic.WebLayout");
        resourceService.SetResource(newLayout, new
MgByteReader(doc.OuterXml, "text/xml"), null);

 frameset.InnerHtml = "<frame id=\&quot;frame1\&quot;
name=\&quot;frame1\&quot;
src=\&quot;../mapviewernet/ajaxviewer.aspx?SESSION=&quot; + sessionId +
&quot;&amp;WEBLAYOUT=Session:&quot; + sessionId +
&quot;//basic.WebLayout&quot; + &quot;\&quot;&quot; + &quot;
noresize=\&quot;yes\&quot; scrolling=\&quot;no\&quot;></frame>";

--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/Map-fails-to-initialize-about-25-of-the-time-tp6934628p6934628.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list