nanoblocktech/html-image-map

PHP类,用于创建HTML图像映射。

1.1 2023-12-21 18:15 UTC

This package is auto-updated.

Last update: 2024-09-21 21:19:39 UTC


README

根据坐标生成图像映射

通过Composer安装指南

composer require nanoblocktech/html-image-map

用法

初始化类

use Luminova\ExtraUtils\ImageMapper\ImageMapper;
$map = new ImageMapper();

创建图像映射,它将返回ImageMapAreas实例

$image = $map->addImage('http://example.com/path/to/image.png');

添加您的映射、区域和坐标 b

$area = $image->addArea(ImageMapper::RECTANGLE, 'My Area Title');
$area->bindOnclick('myFunction();');
$area->setCoordinates([44, 180, 60]);


$area2 = $image->addArea(ImageMapper::CIRCLE, 'My Area 2  Title');
$area2->bindLink('https://example.com/foo');
$area2->setCoordinates([100, 380, 60]);

// Get your image map

$image->display();

ImageMapper的方法

$map = new ImageMapper();

ImageMapper常量变量

addImage的方法

$image = $map->addImage('http://example.com/path/to/image.png');