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


PHP Map::getImage方法代码示例

本文整理汇总了PHP中Map::getImage方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::getImage方法的具体用法?PHP Map::getImage怎么用?PHP Map::getImage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Map的用法示例。


在下文中一共展示了Map::getImage方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: draw

 /**
  * it draws object on map
  *
  * @param Map $map
  */
 public function draw(Map $map)
 {
     $points = array();
     $count = 0;
     foreach ($this->_points as $point) {
         $coordinates = $map->getPixelPointFromCoordinates($point->getLon(), $point->getLat());
         $points[] = $coordinates['x'];
         $points[] = $coordinates['y'];
         $count++;
     }
     if ($count < 3) {
         return;
     }
     imagefilledpolygon($map->getImage(), $points, $count, $this->_getDrawColor($map->getImage()));
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:20,代码来源:FilledPolygon.php

示例2: putImage

 /**
  * method puts image onto map image
  * 
  * @param Map  $map
  * @param resources $imageToPut
  */
 public function putImage(Map $map, $imageToPut)
 {
     $mapImage = $map->getImage();
     $width = imagesx($imageToPut);
     $height = imagesy($imageToPut);
     imagecopy($mapImage, $imageToPut, imagesx($mapImage) - $width, 0, 0, 0, $width, $height);
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:13,代码来源:RightUpCorner.php

示例3: draw

 /**
  * draw point on map
  *
  * @param Map $map
  */
 public function draw(Map $map)
 {
     $image = $map->getImage();
     $color = $this->_getDrawColor($image);
     $pointInPixels = $map->getPixelPointFromCoordinates($this->_coordinates['lon'], $this->_coordinates['lat']);
     imagesetpixel($image, $pointInPixels['x'], $pointInPixels['y'], $color);
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:12,代码来源:Point.php

示例4: draw

 /**
  * draw line on map
  *
  * @param Map $map
  */
 public function draw(Map $map)
 {
     $image = $map->getImage();
     $startPointInPixels = $map->getPixelPointFromCoordinates($this->_startPoint->getLon(), $this->_startPoint->getLat());
     $endPointInPixels = $map->getPixelPointFromCoordinates($this->_endPoint->getLon(), $this->_endPoint->getLat());
     $this->_drawLine($image, $startPointInPixels['x'], $startPointInPixels['y'], $endPointInPixels['x'], $endPointInPixels['y']);
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:12,代码来源:Line.php

示例5: _findOutWhichLabel

 /**
  * methods find out which label should be used for map
  *
  * @param float $scale
  * @param float $equatorPixelsPerKm
  */
 private function _findOutWhichLabel($scale, $equatorPixelsPerKm)
 {
     $mapWidth = imagesx($this->_map->getImage());
     $maxLenghtOfScaleBar = $mapWidth / 4;
     foreach (self::$possibleLables as $label) {
         if ($this->_calculateLengthOfScaleBar($label, $scale, $equatorPixelsPerKm) < $maxLenghtOfScaleBar) {
             return $label;
         }
     }
     return $label;
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:17,代码来源:ScaleBar.php

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

示例7: draw

 /**
  * draw point on map
  *
  * @param Map $map
  */
 public function draw(Map $map)
 {
     $image = $map->getImage();
     $color = $this->_getDrawColor($image);
     $pointImage = false;
     if ($this->hasImageUrl()) {
         $size = HelpClass::getSizeOfRemoteFile($this->_imageUrl->getUrl());
         if ($size <= self::$maxSizeOfPointImage) {
             try {
                 $imageHandler = ImageHandler::createImageHandlerFromFileExtension($this->_imageUrl->getUrl());
                 $pointImage = $imageHandler->loadImage($this->_imageUrl->getUrl());
             } catch (ImageHandlerException $e) {
             }
         }
     }
     if ($pointImage !== false) {
         $map->putImage($pointImage, $this->getLon(), $this->getLat());
     } else {
         $color = $this->_getDrawColor($image);
         $point = $map->getPixelPointFromCoordinates($this->getLon(), $this->getLat());
         $vertices = array($point['x'], $point['y'], $point['x'] - 10, $point['y'] - 20, $point['x'] + 10, $point['y'] - 20);
         imagefilledpolygon($map->getImage(), $vertices, 3, $color);
     }
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:29,代码来源:MarkPoint.php

示例8: putImage

 /**
  * method puts image onto map image
  *
  * @param Map  $map
  * @param resources $imageToPut
  */
 public function putImage(Map $map, $imageToPut)
 {
     $mapImage = $map->getImage();
     $width = imagesx($imageToPut);
     $height = imagesy($imageToPut);
     if ($map instanceof LogoMap) {
         $layout = $map->getLogoLayout();
         $logoImage = $map->getLogoImage();
         if ($logoImage !== false && $layout instanceof LayoutRightDownCorner) {
             $logoHeight = imagesy($logoImage);
             imagecopymerge($mapImage, $imageToPut, imagesx($mapImage) - $width, imagesy($mapImage) - $height - $logoHeight, 0, 0, $width, $height, 100);
             return;
         }
     }
     imagecopymerge($mapImage, $imageToPut, imagesx($mapImage) - $width, imagesy($mapImage) - $height, 0, 0, $width, $height, 100);
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:22,代码来源:RightDownCornerScaleBar.php

示例9: putImage

 /**
  * method puts image onto map image
  * 
  * @param Map  $map
  * @param resources $imageToPut
  */
 public function putImage(Map $map, $imageToPut)
 {
     $mapImage = $map->getImage();
     imagecopy($mapImage, $imageToPut, 0, 0, 0, 0, imagesx($imageToPut), imagesy($imageToPut));
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:11,代码来源:LeftUpCorner.php

示例10: Map

<?php

include "Map.php";
header('Content-type: image/jpeg');
$img = new Map();
$img->addMark(0, 0, "Test1");
$img->addMark(1509.2726, -886.655, "Test2");
$img->addMark(-2065.115, -83.5138, "Test3");
$img->addMark(1711.824, -1894.1769, "Test4");
imagejpeg($img->getImage());
imagedestroy($img->getImage());
开发者ID:ChristianWolf1997,项目名称:SanAndreasMap,代码行数:11,代码来源:index.php

示例11: _prepareOutputMap

 /**
  * create output map from the temoporary one
  *
  * @param Map $map
  */
 private function _prepareOutputMap($map)
 {
     $image = $map->getImage();
     $outputMapLeftUpInPixels = $this->_getLeftUpCornerForCutingResultMap($map);
     $resultMap = new Map($this->_createResultMapImage($image, $outputMapLeftUpInPixels['x'], $outputMapLeftUpInPixels['y'], $this->_mapData->getWidth(), $this->_mapData->getHeight()));
     $this->_setUpResultMapCorners($resultMap);
     $resultMap->setWorldMap($this->_worldMap);
     $resultMap->setImageHandler($this->_tileSource->getImageHandler());
     return $resultMap;
 }
开发者ID:pafciu17,项目名称:gsoc-os-static-maps-api,代码行数:15,代码来源:MapProcessor.php


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