PHP code example of androlax2 / acf-image-map

1. Go to this page and download the library: Download androlax2/acf-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/ */

    

androlax2 / acf-image-map example snippets


$field
  ->addImage('my_image')
  ->addField('my_point_coords', 'image_map', [
    'image_field_label' => 'my_image',
    'shape' => 'point',
    'percentage' => true,
  ]);

$field
  ->addImage('my_image')
  ->addField('my_poly_coords', 'image_map', [
    'image_field_label' => 'my_image',
    'shape' => 'poly',
  ]);

$field
  ->addImage('my_image')
  ->addField('my_point_coords', 'image_map', [
    'image_field_label' => 'my_image',
    'shape' => 'point',
    'percentage' => true,
  ]);

$image = get_field('my_image');
$point = get_field('my_point_coords');
  
<div style="position: relative;">
  <img src=" echo $image['url']; 

$field
  ->addImage('my_image')
  ->addField('my_poly_coords', 'image_map', [
    'image_field_label' => 'my_image',
    'shape' => 'poly',
  ]);

$image = get_field('my_image');
$poly = get_field('my_point_coords');
  
<div style="position: relative;">
  <img src=" echo $image['url'];