本文整理汇总了PHP中Map::getPixelPointFromCoordinates方法的典型用法代码示例。如果您正苦于以下问题:PHP Map::getPixelPointFromCoordinates方法的具体用法?PHP Map::getPixelPointFromCoordinates怎么用?PHP Map::getPixelPointFromCoordinates使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Map
的用法示例。
在下文中一共展示了Map::getPixelPointFromCoordinates方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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']);
}
示例2: 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);
}
示例3: 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()));
}
示例4: 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);
}
}