本文整理汇总了PHP中Map::getLeftUpCorner方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::getLeftUpCorner方法的具体用法?PHP Map::getLeftUpCorner怎么用?PHP Map::getLeftUpCorner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::getLeftUpCorner方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _calculateScale
private function _calculateScale()
{
$leftUp = $this->_map->getLeftUpCorner();
$rightDown = $this->_map->getRightDownCorner();
$lat = abs(($leftUp['lat'] + $rightDown['lat']) / 2);
return 1 / cos(deg2rad($lat));
}
示例2: _getLeftUpCornerForCutingResultMap
/**
* get pixel coordinates for cuting result map from temporary one
*
* @return array coordinates of the left up corner
*/
protected function _getLeftUpCornerForCutingResultMap(Map $map)
{
$leftUpCornerOfTemporaryMap = $map->getLeftUpCorner();
$leftUpCornerOfTemporaryMapInPixels = $this->_worldMap->getPixelXY($leftUpCornerOfTemporaryMap['lon'], $leftUpCornerOfTemporaryMap['lat']);
$leftUpCornerOfResultMap = $this->_mapData->getLeftUpCornerPoint();
$leftUpCornerOfResultMapInPixels = $this->_worldMap->getPixelXY($leftUpCornerOfResultMap['lon'], $leftUpCornerOfResultMap['lat']);
return array('x' => $leftUpCornerOfResultMapInPixels['x'] - $leftUpCornerOfTemporaryMapInPixels['x'], 'y' => $leftUpCornerOfResultMapInPixels['y'] - $leftUpCornerOfTemporaryMapInPixels['y']);
}
示例3: setData
public function setData(Map $map)
{
$leftUp = $map->getLeftUpCorner();
$rightDown = $map->getRightDownCorner();
$this->setLeft($leftUp['lon']);
$this->setUp($leftUp['lat']);
$this->setRight($rightDown['lon']);
$this->setDown($rightDown['lat']);
}
示例4: _getLeftUpCornerForCutingResultMap
/**
* get pixel coordinates for cuting result map from temporary one
*
* @return array coordinates of the left up corner
*/
protected function _getLeftUpCornerForCutingResultMap(Map $map)
{
$leftUpBigMap = $map->getLeftUpCorner();
$leftUpBigMapInPixels = $this->_worldMap->getPixelXY($leftUpBigMap['lon'], $leftUpBigMap['lat']);
$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));
$result = array('x' => $leftUpPointInPixels['x'] - $leftUpBigMapInPixels['x'], 'y' => $leftUpPointInPixels['y'] - $leftUpBigMapInPixels['y']);
return $result;
}
示例5: __construct
public function __construct(Map $map, Conf $conf)
{
$this->setImageHandler($map->getImageHandler());
$this->_logoLayout = LogoLayout::factory($conf->get('logo_layout'));
$this->_logoFiles = $conf->get('logo_files');
$this->setWorldMap($map->getWorldMap());
$leftUpCorner = $map->getLeftUpCorner();
$this->setLeftUpCorner($leftUpCorner['lon'], $leftUpCorner['lat']);
$rightDownCorner = $map->getRightDownCorner();
$this->setRightDownCorner($rightDownCorner['lon'], $rightDownCorner['lat']);
parent::__construct($map->getImage());
}