本文整理汇总了PHP中Map::setLeftUpCorner方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::setLeftUpCorner方法的具体用法?PHP Map::setLeftUpCorner怎么用?PHP Map::setLeftUpCorner使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::setLeftUpCorner方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _setUpResultMapCorners
/**
* it sets coordinates of the left up and right down corners of the result map
*
* @param Map $resultMap
*/
protected function _setUpResultMapCorners(Map $resultMap)
{
$leftUpCorner = $this->_mapData->getLeftUpCornerPoint();
$resultMap->setLeftUpCorner($leftUpCorner['lon'], $leftUpCorner['lat']);
$rightDownCorner = $this->_mapData->getRightDownCornerPoint();
$resultMap->setRightDownCorner($rightDownCorner['lon'], $rightDownCorner['lat']);
}
示例2: _setUpResultMapCorners
/**
* it sets coordinates of the left up and right down corners of the result map
*
* @param Map $resultMap
*/
protected function _setUpResultMapCorners(Map $resultMap)
{
$centerPoint = $this->_mapData->getCenterPoint();
$centerPointInPixels = $this->_worldMap->getPixelXY($centerPoint['lon'], $centerPoint['lat']);
$leftUpPointInPixels = array('x' => $centerPointInPixels['x'] - round($this->_mapData->getWidth() / 2), 'y' => $centerPointInPixels['y'] - round($this->_mapData->getHeight() / 2));
$resultMap->setLeftUpCorner($this->_worldMap->getLon($leftUpPointInPixels['x']), $this->_worldMap->getLat($leftUpPointInPixels['y']));
$rightDownPointInPixels = array('x' => $centerPointInPixels['x'] + round($this->_mapData->getWidth() / 2), 'y' => $centerPointInPixels['y'] + round($this->_mapData->getHeight() / 2));
$resultMap->setRightDownCorner($this->_worldMap->getLon($rightDownPointInPixels['x']), $this->_worldMap->getLat($rightDownPointInPixels['y']));
}
示例3: _concatenateTiles
/**
* concatenate tiles to one map
*
* @param array $tiles
* @return Map
*/
protected function _concatenateTiles($tiles)
{
$height = count($tiles) * $this->_tileSource->getTileWidth();
$width = count($tiles[0]) * $this->_tileSource->getTileHeight();
$imageHandler = $this->_tileSource->getImageHandler();
$mapImage = $imageHandler->createImage($width, $height);
$y = 0;
$firstTile = $tiles[0][0];
foreach ($tiles as $rowKey => $row) {
$x = 0;
foreach ($row as $tileKey => $tile) {
imagecopy($mapImage, $tile->getImage(), $x, $y, 0, 0, $this->_tileSource->getTileWidth(), $this->_tileSource->getTileHeight());
$x += $this->_tileSource->getTileWidth();
}
$y += $this->_tileSource->getTileHeight();
}
$map = new Map($mapImage);
$leftUp = $firstTile->getLeftUpCorner();
$map->setLeftUpCorner($leftUp['lon'], $leftUp['lat']);
$map->setWorldMap($this->_worldMap);
$map->setImageHandler($this->_tileSource->getImageHandler());
return $map;
}