[mapguide-users] Extending the functionality of built-in commands (Ajax viewer)

gingerbbm stuart.jones at jacobs.com
Mon Sep 15 08:52:57 EDT 2008


Kenneth, you are a star.

I tweaked your code as follows to prove the visibility toggling:

    $map = new MgMap(); 
    $map->Open($resourceService, $mapName); 
    $map->GetLayers()->GetItem(0)->SetVisible(true);
    $resId = new MgResourceIdentifier("Session:$sessionID//$mapName.Map");
    $resId->Validate();
    $map->Save($resourceService, $resId);

Ultimately I needed to change the feature class of a layer. To achieve this
I read in the LayerDefinition from the Library repository, edit the
FeatureName XML element in the desired manner, then write the modified
LayerDefinition to the Session repository, which I use in a
SetLayerDefinition() call on the relevant layer in the runtime map. And it
works a treat!

Thanks
Stuart
-- 
View this message in context: http://n2.nabble.com/Extending-the-functionality-of-built-in-commands-%28Ajax-viewer%29-tp841643p1090337.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list