[mapguide-internals] MapFrame Refreshing problem

Jackie Ng jackie.ng at aecsystems.com.au
Thu Sep 20 19:29:42 EDT 2007


There could be a timing issue with the AJAX viewer in that you are calling
the Refresh() method before the map frame has been fully loaded.

- Jackie


rislam wrote:
> 
> I am writing a program in php and mapguide server. This loads map on a
> weblayout. The problem is that sometimes its working fine but sometimes
> not. 
> I am describing briefly the scenario how i am trying to do it. 
> 
> I am trying to make visibility false on some layers and true to another
> layers and finally refreshing the  mapframe. Here is given a code fragment
> 
> //----------------------  Sample code -----------------------
> 
>  <script language="javascript">
> 
>     function Refresh()
>     {
>     <?
>       echo 'parent.parent.Refresh();';      
>     ?>
>     
>     }
>     function relaodViewer()
>     {
>         this.Refresh();
>     }
>   </script>
> 
> <body onLoad="relaodViewer()">
> 
> <?
>  .............................
> 
> //*** code fragment for opening the map
> MgInitializeWebTier ($configFilePath);
> $userInfo = new MgUserInformation($mgSessionId);
> $siteConnection = new MgSiteConnection();
> $siteConnection->Open($userInfo);
> 
> $resourceService =
> $siteConnection->CreateService(MgServiceType::ResourceService);
> $featureService =
> $siteConnection->CreateService(MgServiceType::FeatureService);
> 
> $map = new MgMap();
> $map->Open($resourceService, $mapName);
> 
> 
> //*** Makes invisible all the layers		
> 
> for($i=0;$i<$map->GetLayers()->GetCount();$i++)
> {
> 	$layer = $map->GetLayers()->GetItem($i);
> 	$layer->SetVisible(false);      
> }
> 
> //*** make visible my required layer
> 
> $layer = $map->GetLayers()->GetItem('rasterlayer');
> $layer->SetVisible(true);
> 
> 
> //*** Save the map
> $map->Save($resourceService);
> 
> ?>
> </body>
> 
> //------------------------------ End Code
> -------------------------------------
> 
> 
> 
> The following link is the example of the problem.
> 
>  http://mail.dijkoraad-hawar.nl/grossier/ID01Problem/RefreshProblem.html
> Click here 
> There are two images: 
> i. image1 and ii. image2
> 
> image1 is ok. That is shows all required(colored) layers.
> But image2 is not ok. The required layers aren't present here. 
> 
> 
> Thanks in advance for any kind of help…
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/MapFrame-Refreshing-problem-tf4473746s16610.html#a12807982
Sent from the MapGuide Internals mailing list archive at Nabble.com.



More information about the mapguide-internals mailing list