コード例 #1
0
 /**
  * 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;
 }
コード例 #2
0
 /**
  * create result image from given temporary image
  *
  * @param resource $image
  * @param int $leftUpX x-coordinate of the left up corner of the new image
  * @param int $leftUpY y-coordinate of the left up corner of the new image
  * @param int $width width of the new image
  * @param int $height of the new image
  * @return resource
  */
 protected function _createResultMapImage($image, $leftUpX, $leftUpY, $width, $height)
 {
     if ($leftUpY < 0) {
         $height += $leftUpY;
         $leftUpY = 0;
     }
     $imageWidth = imagesx($image);
     $imageHeight = imagesy($image);
     if ($leftUpY + $height > $imageHeight) {
         $height = $imageHeight - $leftUpY;
     }
     $newImage = $this->_tileSource->getImageHandler()->createImage($width, $height);
     imagecopy($newImage, $image, 0, 0, $leftUpX, $leftUpY, $width, $height);
     return $newImage;
 }
コード例 #3
0
 protected function _run()
 {
     $this->_tile = $this->_tileSource->getTile($this->_tileNumbers['x'], $this->_tileNumbers['y'], $this->_worldMap->getZoom());
     $this->_isLoaded = true;
 }
コード例 #4
0
 /**
  * it starts loading the tile image
  *
  */
 public function start()
 {
     $this->_tile = $this->_tileSource->getTile($this->_tileData['x'], $this->_tileData['y'], $this->_tileData['zoom']);
     $this->_isLoaded = true;
 }