当前位置: 首页>>代码示例>>PHP>>正文


PHP Map::setLeftUpCorner方法代码示例

本文整理汇总了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']);
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:12,代码来源:FromBoundaryBox.php

示例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']));
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:14,代码来源:FromCenterPoint.php

示例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;
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:29,代码来源:MapProcessor.php


注:本文中的Map::setLeftUpCorner方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。