PHP code example of nanoblocktech / html-image-map

1. Go to this page and download the library: Download nanoblocktech/html-image-map library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

nanoblocktech / html-image-map example snippets


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

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

$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();