[Chameleon] WMSBrowser question

He, Matt Yubin mhe at itsc.uah.edu
Wed Feb 22 17:03:08 EST 2006


Hi All:

	I use WMSBrowser in my Chameleon application to add a layer.
However, the added layer in map file did not have a "Group" name. 
	Does anyone know how to add a Group name to the new layer?

Thanks.

Matt

P.S. Following is the code for adding new layer in WMSBrowser widget. 
// add the layer to the map
if (is_numeric($szLayer));
{
   $oWMSDatabase = new WMSDatabase( $_SESSION["gszServerDataPath"] );
   $oServerDataManager = new ServerDataManager( $oWMSDatabase );
   $oWMSLayer = $oServerDataManager->getLayerObj( $szLayer );
   if ($oWMSLayer == null)
   {
      $_SESSION['gErrorManager']->setError(ERR_WARNING,
          "ERROR: could not add layer $szLayer to map!" );
      return false;
                    
   }
   $oLayer = ms_newLayerObj( $this->moMapObject->oMap, $oWMSLayer );
                        
// get the current map projection
   $szTempMapProj = $this->moMapObject->oMap->getprojection();
                        
// only set the projection if it's set in the map
   if ( strlen( trim( $szTempMapProj ) ) > 0 )
   {
// set layer projection
      $oLayer->setprojection( $szTempMapProj );
   }
            
   $_SESSION['gszCurrentState'] = $this->moMapObject->saveState();
}





More information about the Chameleon mailing list