Example #1
0
File: Wms.php Project: Gnafu/wiz
 public static function getLayers()
 {
     $layers = Wms::model()->findAllByAttributes(array('username' => Yii::app()->user->id));
     $return = array();
     foreach ($layers as $i => $l) {
         $return[] = array('name' => $l->name, 'title' => $l->title, 'url' => $l->url, 'projection' => $l->projection);
     }
     return $return;
 }
Example #2
0
File: _map.php Project: Gnafu/wiz
        echo ', group:\'' . $l['group'] . '\'';
    }
    ?>
					}
				);
			map.addLayer(layer_<?php 
    echo $l['layer'];
    ?>
);

<?php 
}
?>

<?php 
foreach (Wms::getLayers() as $l_id => $l) {
    ?>
var layer_<?php 
    echo $l['name'];
    ?>
 = new OpenLayers.Layer.WMS(
		"<?php 
    echo $l['title'];
    ?>
",
		"<?php 
    echo $l['url'];
    ?>
",
		{
	        layers: "<?php 
Example #3
0
 /**
  * Returns the data model based on the primary key given in the GET variable.
  * If the data model is not found, an HTTP exception will be raised.
  * @param string $id the identifier of the model to be loaded
  */
 public function loadModel($name)
 {
     $model = Wms::model()->findByPk(array('username' => Yii::app()->user->id, 'name' => $name));
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }