[mapguide-users] Nothing is working or what I'm doing wrong?

Galois amihalas at yahoo.gr
Mon Oct 20 09:45:46 EDT 2008


Whatever I try to do it's just not working.

Add a new layer?
The layer is added but never shown

Add a point? Nothing

Add a new group?
The Group is added but never shown

So, I simple tried to change the LegendLabel of an existing layer.
Nothing happened again...

If anyone can tell me what I am doing wrong I would appreciate it.

Code follows:


using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using OSGeo.MapGuide;
using System.Xml;
using System.IO;
using System.Text;

public partial class _Default : System.Web.UI.Page
{
    public string sessionId;
    public string webLayout;
    public MgLayer tmpLayer;
    protected System.Web.UI.HtmlControls.HtmlGenericControl Frame1;

    protected void Page_Load(object sender, EventArgs e)
    {
        string physicalPath = @"C:\Program
Files\MapGuideOpenSource\WebServerExtensions\www\webconfig.ini";

        try
        {
            MapGuideApi.MgInitializeWebTier(physicalPath);


            passAndSession();


            //Associate a session ID with the MgSiteConnection Object
            MgUserInformation userInfo_new = new
MgUserInformation(sessionId);

            MgSiteConnection siteConnection = new MgSiteConnection();

            siteConnection.Open(userInfo_new);



            // Get an instance of the required service(s)
            MgResourceService resourceSrvc =
(MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
            MgFeatureService featureSrvc =
(MgFeatureService)siteConnection.CreateService(MgServiceType.FeatureService);



            MgMap map = new MgMap(siteConnection);


            webLayout =
"Library://GoSpatial/Web+Layouts/Autostrada+Brescia+Padova+Map.WebLayout";

            MgResourceIdentifier resId = new
MgResourceIdentifier("Library://GoSpatial/Maps/Italy Map.MapDefinition");

            String mapName = resId.GetName();

            MgResourceIdentifier mapStateId = new
MgResourceIdentifier("Session:" + sessionId + "//" + mapName + "." +
MgResourceType.Map);



            createSaveOpen(map, resourceSrvc, resId, mapName, mapStateId);


            MgLayerBase firstLayer = map.GetLayers().GetItem(0);
            firstLayer.SetLegendLabel("CHANGE");
            

            map.Save(resourceSrvc, mapStateId);
        }
        catch (Exception ex)
        {
            throw (ex);
        }
    }


Thx in advanced!

PS I have never but never in my life try to do something and in 2 weeks not
shown even a small improvement...
-- 
View this message in context: http://www.nabble.com/Nothing-is-working-or-what-I%27m-doing-wrong--tp20067506p20067506.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list