<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-2" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
I can't guess what you want to do.<br>
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.<br>
If you want to read the name, open the WebLayout, look at the
resourceID: "Library://Folder/MyMap.MapDefinition".<br>
In the above case, the name will be "MyMap". It will be stored as
"Session:xxx//MyMap.Map" where xxx is the session id.<br>
<br>
The rename operation is called "MoveResource" but I don't know how it
is exposed in the API.<br>
Beware that moving resources will break any references to the resource.<br>
<br>
A much easier approach is to save the map under a different name. <br>
If you save in the session repository, it will be cleaned up on session
expiration.<br>
<br>
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.<br>
<pre class="moz-signature" cols="72">Regards, Kenneth, GEOGRAF A/S
</pre>
<br>
<br>
Ivan Milicevic skrev:
<blockquote cite="mid:9CAB6B340CCF9E44BE4ACFCF56E67B070DA237@supranet"
 type="cite">
  <pre wrap="">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 

  </pre>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
mapguide-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:mapguide-users@lists.osgeo.org">mapguide-users@lists.osgeo.org</a>
<a class="moz-txt-link-freetext" href="http://lists.osgeo.org/mailman/listinfo/mapguide-users">http://lists.osgeo.org/mailman/listinfo/mapguide-users</a>
  </pre>
</blockquote>
</body>
</html>