[mapguide-users] Maestro API: RuntimeMapLayer.Selectable can't be changed

carls carlshe at 163.com
Sun Oct 26 11:31:21 EDT 2008


I want to add a runtimemaplayer to a runtime map, and write follow code.

            ResourceIdentifier ri =
CloneLayerDefinitionForSession(LayerPath, AsLayerName, SessionID);

            RuntimeMapLayer rtl = new RuntimeMapLayer(ParentMap);

            rtl.ResourceId = ri.ToString();
            rtl.Visible = true;
            rtl.LegendLabel = AsLayerName;
            rtl.NeedRefresh = true;
            rtl.Selectable = true;
            if (ParentMap != null)
                AddRuntimeMapLayerToRuntimeMap(ParentMap, rtl);  
            return rtl;

The runtimemaplayer refers to a sql 2008 data source.

The bold line of above code can't be executed, the full message is :

   
[WebException: ...: (559) MgInvalidRepositoryTypeException。]
   System.Net.WebClient.OpenRead(Uri address) +366
   System.Net.WebClient.OpenRead(String address) +29
   OSGeo.MapGuide.MaestroAPI.HttpServerConnection.OpenRead(String req) in
E:\Temp\Maestro\MaestroAPI\HttpServerConnection.cs:1078

[Exception: ...: (559) MgInvalidRepositoryTypeException。: 
Invalid repository type.
Exception occurred in method MgResourceIdentifier.ParseIdentifier at line
420 in file
d:\buildforgeprojects\mapguide_open_source_v2.0\build_23.8\mgdev\common\platformbase\Services/ResourceIdentifier.cpp

]
   OSGeo.MapGuide.MaestroAPI.HttpServerConnection.OpenRead(String req) in
E:\Temp\Maestro\MaestroAPI\HttpServerConnection.cs:1086
   OSGeo.MapGuide.MaestroAPI.HttpServerConnection.GetResourceXmlData(String
resourceID) in E:\Temp\Maestro\MaestroAPI\HttpServerConnection.cs:299
   OSGeo.MapGuide.MaestroAPI.ServerConnectionBase.GetResource(String
resourceID) in E:\Temp\Maestro\MaestroAPI\ServerConnectionBase.cs:380
   OSGeo.MapGuide.MaestroAPI.ServerConnectionBase.GetFeatureSource(String
resourceID) in E:\Temp\Maestro\MaestroAPI\ServerConnectionBase.cs:357
  
OSGeo.MapGuide.MaestroAPI.RuntimeClasses.RuntimeMapLayer.FindResourceIDs(ServerConnectionI
con) in E:\Temp\Maestro\MaestroAPI\RuntimeClasses\RuntimeMap.cs:726
  
OSGeo.MapGuide.MaestroAPI.RuntimeClasses.RuntimeMapLayer.FindResourceIDs()
in E:\Temp\Maestro\MaestroAPI\RuntimeClasses\RuntimeMap.cs:752
  
OSGeo.MapGuide.MaestroAPI.RuntimeClasses.RuntimeMapLayer.set_Selectable(Boolean
value) in E:\Temp\Maestro\MaestroAPI\RuntimeClasses\RuntimeMap.cs:1039
   ...


Thanks for help!

-----
Regards, Carl SHE
-- 
View this message in context: http://n2.nabble.com/Maestro-API%3A-RuntimeMapLayer.Selectable-can%27t-be-changed-tp1379205p1379205.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list