[mapguide-users] Mapguide beta 2.4: quick plot on a basic layout from .net app does not work

Franz1965 fsozzi at INTERCAD.CH
Thu Apr 12 05:07:56 EDT 2012


Hi list,

I've just downloaded Mapguide 2.4 beta and tried to compile a very simple
.Net c# application. 
My target is to use the great new feature "QuickPlot" on my basic layout
(this layout type is a must for me, I have an application based on this).
But I have problems on using QuickPLot from a .Net app.

You can see below the code for the very simple single class Default.aspx.
I've created an IIS "Application folder"
http:\\localhost\mapguide\MapGuideSample and I execute my app from there.

My problem is that:
- if I preview from Maestro my web layout
(Library://TBDemoMesoccoCan/BasicLayout.it.WebLayout) I can use QuickPlot.
- but if I execute this simple app on the same web layout QuickPlot is not
responsive; I can open the dialog, but it does nothing. I can't see the
rectangle on the map and if I press "Generate" button, nothing happens. No
errors are displayed.


--------------------------------------------------------------------------------------------------------------------------
Default.aspx
--------------------------------------------------------------------------------------------------------------------------

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs"
Inherits="MapGuideSample.Default" %>

<!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot;
&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;>

<html>
<head>
	<title>Viewer Sample Application</title> </head>
        <frameset id="idFrameset" rows="0,*" frameborder="no"
framespacing="0" runat="server">
	        <frame id="idFBanner" frameborder="no" marginwidth="0"
marginheight="0" scrolling="no"  runat="server"/>
	        <frame id="idFMap" frameborder="no" marginwidth="0"
marginheight="0" scrolling="no" runat="server"/>
        </frameset>
</html>

--------------------------------------------------------------------------------------------------------------------------
Default.aspx.cs
--------------------------------------------------------------------------------------------------------------------------

using System;
using OSGeo.MapGuide;

namespace MapGuideSample
{
    public partial class Default : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            String webLayout =
"Library://TBDemoMesoccoCan/BasicLayout.it.WebLayout";
            String defaultUser = "Administrator";
            String defaultPassword = "admin";
            String sessionId = "";

            try
            {
                // Initialize a session and register a variable to hold the
                // session id, then initialize the Web Extensions, connect
                // to the site, and create a session.

               
OSGeo.MapGuide.MapGuideApi.MgInitializeWebTier(@"C:\trash\MapGuideSample\MapGuideSample\webconfig.ini");

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

                idFMap.Attributes["src"] =
@"http://lptop-franz7vmwin7/Mapguide/mapviewernet/ajaxviewer.aspx?SESSION="
+ sessionId + "&WEBLAYOUT=" + webLayout;
            }
            catch (Exception ex)
            {
                Response.Write(ex.Message);
            }
        }
    }
}

--------------------------------------------------------------------------------------------------------------------------

Thanks in advance for any help...


--
View this message in context: http://osgeo-org.1560.n6.nabble.com/Mapguide-beta-2-4-quick-plot-on-a-basic-layout-from-net-app-does-not-work-tp4848681p4848681.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list