/**
  * 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.");
     }
 }
Beispiel #3
0
 /**
  * Initializes the marker.
  * @throws \yii\base\InvalidConfigException
  */
 public function init()
 {
     parent::init();
     if (empty($this->latLng)) {
         throw new InvalidConfigException("'latLng' attribute cannot be empty.");
     }
 }