[mapguide-users] Help with opening maps from code behind
Kenneth, GEOGRAF A/S
ks at geograf.dk
Mon Dec 10 04:10:51 EST 2007
I can't guess what you want to do.
The name of the map that you are trying to open is constructed by the
AJAX viewer, and is always identical to the name of the MapDefinition on
which it is based.
If you want to read the name, open the WebLayout, look at the
resourceID: "Library://Folder/MyMap.MapDefinition".
In the above case, the name will be "MyMap". It will be stored as
"Session:xxx//MyMap.Map" where xxx is the session id.
The rename operation is called "MoveResource" but I don't know how it is
exposed in the API.
Beware that moving resources will break any references to the resource.
A much easier approach is to save the map under a different name.
If you save in the session repository, it will be cleaned up on session
expiration.
If you want to switch runtime maps, I suggest you try out the Fusion
viewer from MGOS 2.0 Beta 1, as it supports that.
Regards, Kenneth, GEOGRAF A/S
Ivan Milicevic skrev:
> Hello,
>
> is it possible to change map nae programaticly on runtime? I need to change map name, do something with layers and then render map image. I'm struggling with this for last 20h.
>
> Please if somebody can help me. The problem is down below at commented line.
>
> string mgSessionId = Request.QueryString["mgSessionId"].ToString();
> string idK = Page.Request.QueryString["idK"];
> string idZ = Page.Request.QueryString["idZ"];
> string oznakaZdenca;
> string cijeviKabela;
> int i = 0;
>
> bool showPreviousResults = false;
> MgSiteConnection siteConnection = null;
> InitializeWebTier();
> MgUserInformation userInfo = new MgUserInformation(mgSessionId);
> siteConnection = new MgSiteConnection();
> siteConnection.Open(userInfo);
> MgResourceService resourceService = siteConnection.CreateService(MgServiceType.ResourceService) as MgResourceService;
> MgFeatureService featureService = siteConnection.CreateService(MgServiceType.FeatureService) as MgFeatureService;
> MgMap map = new MgMap();
> map.Open(resourceService, "1"); //opening map with name "1". I need to change map name here
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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/20071210/87415ae4/attachment.html
More information about the mapguide-users
mailing list