[mapguide-users] Re: Modify mapdefinition in a layout

SriRam007 binod_tripathy at yahoo.co.in
Wed Apr 7 08:18:49 EDT 2010


Hi euskalmap,

I m trying to get the xml format of Mapdefinition.

for pst_map and pst_weblayout parameter what u r passing 

pst_map = MapName??  (is it "Sheboygan")

pst_weblayout = WebLayoutName??  (is it "SheboyganAsp")

Here is my code 

********************************************************
    public String MapName = "Sheboygan";
    public String WebLayoutName = "SheboyganAsp";

    protected void btnGetMapDefn_Click(object sender, EventArgs e)
    {
        Utility.InitializeWebTier(Request);
        string NewMapDefinitionStr = "Session:" + Session["ID"].ToString() +
"//" + MapName + ".MapDefinition";
        MgUserInformation userInfo = new
MgUserInformation(Session["ID"].ToString());
        MgSiteConnection siteConnection = new MgSiteConnection();
        siteConnection.Open(userInfo);
        MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

        MgMap map = new MgMap();
        map.Open(resourceService, MapName);

        MgResourceIdentifier WebLayoutId = new
MgResourceIdentifier(WebLayoutName);//Error is showing "Invalid repository
type."
        MgByteReader byteReader =
resourceService.GetResourceContent(WebLayoutId);
        XmlDocument doc = new XmlDocument();
        string xmlLayoutDef = byteReader.ToString();
        doc.LoadXml(xmlLayoutDef);
}
********************************************************
please give anyone some idea


thanks
-- 
View this message in context: http://n2.nabble.com/Modify-mapdefinition-in-a-layout-tp2462320p4864521.html
Sent from the MapGuide Users mailing list archive at Nabble.com.


More information about the mapguide-users mailing list