[mapguide-users] Changing Visibility for one layer affects others
Paul Spencer
pagameba at gmail.com
Tue Jan 22 14:04:28 EST 2008
this may not help, but try saving the map using
$map->Save($ressvc, $mapName);
Cheers
Paul
On 22-Jan-08, at 10:30 AM, nclayton wrote:
>
> Hi all,
> I am trying to add functionality to toggle raster images on and off
> to my
> map. I have the raster images on a layer called aerial. I am calling
> a php
> page with the following function call in the scriptFrame:
>
> toggleLayer($sessionId,$mapName,"aerial");
>
> The function is:
>
> function toggleLayer($sessId,$mapName,$layerName){
> try{
> $userInfo = new MgUserInformation($sessId);
> $siteConnection = new MgSiteConnection();
> $siteConnection->Open($userInfo);
> $ressvc = $siteConnection-
> >CreateService(MgServiceType::ResourceService);
> $map = new MgMap();
> $map->Open($ressvc,$mapName);
> $tlyr = $map->GetLayers()->GetItem($layerName);
> $tlyr->SetVisible(!($tlyr->GetVisible()));
> $map->Save($ressvc);
> }catch(Exception $e){
>
> }
> }
>
> This is causing the layer to become visible, but it is also causing
> other
> layers to not be visible.
> I've made a page with images showing what is happening, and it is
> located
> at:
>
> http://www.tscmaps.com/issue.htm http://www.tscmaps.com/issue.htm
>
> Thank you for your help
>
> --
> View this message in context: http://www.nabble.com/Changing-Visibility-for-one-layer-affects-others-tp15021169s16610p15021169.html
> Sent from the MapGuide Users mailing list archive at Nabble.com.
>
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
More information about the mapguide-users
mailing list