[mapguide-users] Changing Visibility for one layer affects others

nclayton nclayton at gmail.com
Tue Jan 22 10:49:25 EST 2008


It is at the very bottom of the drawing stack. The layer is pulling from an
aliased folder on the server and contains 595 ecw files. I'm not sure if
that could be a factor in this issue, especially since the layers do not
return once the raster layer is set to no longer be visible.



andrew.demerchant wrote:
> 
> Without looking at your code, I'm wondering if maybe your raster image 
> layer is above your other layers. I'd check your layer ordering. I know 
> how to do that in Mapguide Studio or Web Studio, but not so sure using
> code.
> 
> Andrew
> 
> 
> 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
>>
>>   
> 
> -- 
> 	*Andrew DeMerchant*
> *Computer Technologist*
> ph.1-877-2GEMTEC x.163
> fax 506-453-9470
> 
> /GEMTEC Limited <http://www.gemtec.ca>
> /191 Doak Road
> Fredericton, NB, Canada
> E3C 2E6
> 
> 
> _______________________________________________
> mapguide-users mailing list
> mapguide-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapguide-users
> 
> 

-- 
View this message in context: http://www.nabble.com/Changing-Visibility-for-one-layer-affects-others-tp15021169s16610p15021702.html
Sent from the MapGuide Users mailing list archive at Nabble.com.



More information about the mapguide-users mailing list