[mapguide-users] Regarding Linking of Layers with Map at run time
Stefan Dalakov
s.dalakov at mapware.net
Fri Feb 13 12:40:20 EST 2009
Try
MgResourceIdentifier mapName = new MgResourceIdentifier("Session:" +
sessionId + "//Sheboygan.MapDefinition");
Stefan Dalakov
ravinder.singh at BIRLASOFT.COM wrote:
>
> Hi All,
>
>
>
> I have created the map definition in maestro and also created a web
> layout, and I have hundreds of Maps, and each map will have a single
> layer, but I don't want to create the hundreds of maps for each single
> layer. For that purpose I though I will just make a single map and
> will associate the layer at run time to that map. So I wrote the
> following set of code for Sheboygan sample
>
>
>
> But when I reach to map.Save(resourceSrvc, mapName)
>
>
>
> it gives me the error
>
>
>
> MgXmlParserException {"An exception occurred in the XML parser."}
>
>
>
> And also I tried with Map.Open and then the following error comes
>
>
>
> Resource was not found:
> Session:b275c3b6-ffff-ffff-8000-001a4bb4a756_en_7F0000010AFC0AFB0AFA//Samples/Sheboygan/Sheboygan.MapDefinition
>
>
>
> I have written the following code
>
>
>
> MgUserInformation userInfo = new MgUserInformation(defaultUser,
> defaultPassword);
>
> MgSite site = new MgSite();
>
> site.Open(userInfo);
>
> sessionId = site.CreateSession();
>
> MgUserInformation userInfo_new = new MgUserInformation(sessionId);
>
> MgSiteConnection siteConnection = new MgSiteConnection();
>
> siteConnection.Open(userInfo_new);
>
> MgResourceService resourceSrvc =
> (MgResourceService)siteConnection.CreateService(MgServiceType.ResourceService);
>
>
> MgResourceIdentifier mapName = new MgResourceIdentifier("Session:" +
> sessionId + "//Samples/Sheboygan/Sheboygan.MapDefinition");
>
> MgMap map = new MgMap();
>
> map.Open(resourceSrvc, mapName); // Here the problem comes
>
> map.Save(resourceSrvc, mapName); // Here the problem comes
>
>
>
> I am using .net aspx with map guide 2.0
>
>
>
> *Thanks & Regards,*
>
> Ravinder Singh
>
>
>
> *********************************************************************************************************************************************************************
> "This message and any attachments are solely for the intended
> recipient and may contain Birlasoft confidential or privileged
> information. If you are not the intended recipient,any
> disclosure,copying, use, or distribution of the information included
> in this message and any attachments is
> prohibited. If you have received this communication in error, please
> notify us by reply e-mail at (administrator at birlasoft.com) and
> permanently delete this message and any attachments. Thank you."
> *********************************************************************************************************************************************************************
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapguide-users/attachments/20090213/06485c6d/attachment.html
More information about the mapguide-users
mailing list