/**
  * Adds a layer to the group. If no name given it will be automatically generated.
  *
  * @param Layer $layer
  *
  * @return $this
  * @throws \yii\base\InvalidParamException
  */
 public function addLayer(Layer $layer)
 {
     if ($layer instanceof Popup || $layer instanceof TileLayer) {
         throw new InvalidParamException("'\$layer' cannot be of type Popup or TileLayer.");
     }
     $layer->map = null;
     $this->_layers[$layer->getName(true)] = $layer;
     return $this;
 }
 /**
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (empty($this->urlTemplate)) {
         throw new InvalidConfigException("'urlTemplate' cannot be empty.");
     }
 }
示例#3
0
文件: Marker.php 项目: haydiru/GIS
 /**
  * Initializes the marker.
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (empty($this->latLng)) {
         throw new InvalidConfigException("'latLng' attribute cannot be empty.");
     }
 }