public function __construct(MapRequest $mapData, TileSource $source)
 {
     $this->_mapData = $mapData;
     $this->_tileSource = $source;
     if (!is_null($this->_mapData->getZoom())) {
         $this->_worldMap = $source->getWorldMap($this->_mapData->getZoom());
     }
     $this->_requestValidator->check();
 }
 /**
  * check if map zoom is given coorect
  *
  * @return bool
  */
 protected function _checkZoom()
 {
     $zoom = $this->_mapData->getZoom();
     $minZoom = $this->_tileSource->getMinZoom();
     $maxZoom = $this->_tileSource->getMaxZoom();
     if (is_null($zoom) || !is_numeric($zoom) || $zoom < $minZoom || $zoom > $maxZoom) {
         return false;
     }
     return true;
 }