Egmap Problem With Kml Layers

I am trying to create a map that load two kml files but the result is that the second kml isn’t loading. What happens?. Sorry my english level is bad. Thanks!!

Controller code:




public function actionView($id)

        {

            $model = $this->loadModel($id);

          

            $fileMapa = Yii::app()->params['dirMapas'].$model->id.'.kml';


            //echo Yii::getPathOfAlias('webroot').DIRECTORY_SEPARATOR.$fileMapa;

            if(file_exists($fileMapa)) {

                $criteria = new CDbCriteria();

                $criteria->compare('id_zona', (int)$model->id);

                $seniales = $seniales = Ensal::model()->findAll($criteria);

                Yii::import('ext.gmap.*');

                

                $gMap = new EGMap();

                $gMap->setWidth('100%');

                $gMap->setHeight('600px');

                $gMap->zoom = 10;

                $mapTypeControlOptions = array(

                    'position'=> EGMapControlPosition::LEFT_BOTTOM,

                    'style'=>EGMap::MAPTYPECONTROL_STYLE_DROPDOWN_MENU,

                    

                );

                

                $options = array(

                    'mapTypeId'=> EGMap::TYPE_HYBRID,

                );

                $gMap->setOptions($options);

 

                $gMap->mapTypeControlOptions= $mapTypeControlOptions;

                $gMap->enableKMLService(Yii::app()->getBaseUrl(true).'/'.$fileMapa, true);

                //echo Yii::app()->getBaseUrl(true).'/'.$fileMapa

                //$gMap->enableKMLService('http://127.0.0.1/'.$fileMapa, true);

                

                // Si existe la capa de red la cargamos

                $fileRed = Yii::app()->params['dirMapas'].$model->id.'-red.kml';

                //print $fileRed;

                if(file_exists($fileRed)) 

                    $gMap->enableKMLService(Yii::app()->getBaseUrl(true).'/'.$fileRed, true);

                

                    

                // Horario nocturno

.....