[mapguide-users] Confusing about reload runtime map

Kenneth, GEOGRAF A/S ks at geograf.dk
Thu Nov 22 03:20:54 EST 2007


Are you mixing som 1.1 and 1.2 API's ?
There were some changes to how the Layers are stored in 1.2.

Make sure your application has the same DLL's as present in the 
installation

Regards, Kenneth, GEOGRAF A/S



Gunter Becker skrev:
> Hi,
>
> several months ago I created a webapplication with MapGuideOpenSource 1.1.
> Now with release 1.2 this code doesn't work anymore but I can't figure out
> what has changed.
>
> The following gets the current runtime map:
>
>   MgMap map = new MgMap();
>   MgResourceIdentifier mapId = new MgResourceIdentifier("Session:" +
> MgSessionId + @"//" + MapName + "." + MgResourceType.Map);
>   map.Open(ResourceService, mapId);
>
> I've tested with "Web Tier Test" that the resource exists and also that the
> map object was instantiated.
> The map object has correct properties but it seems that I can't get any
> layers with the GetLayers() methode.
>
>   MgLayerCollection layers = currentMap.GetLayers(); // Error - The
> requested operation is invalid
>   foreach (MgLayer layer in layers)
>   { 
>   ....
>
> This is the error code:
>
> The requested operation is invalid.
> Exception occurred in method MgMap.UnpackLayersAndGroups at line 640 in file
> c:\build_bond_area\mapguide_open_source_v1.2\build_18.1\mgdev\common\mapguidecommon\MapLayer/Map.cpp
>
> Hope someone can help. It worked for me with MGOS 1.1!
>
> Gunter
>
>
>
>   


More information about the mapguide-users mailing list