2

I need to have options to upload img and drow area on that img and save coordinates to JSON. Similar like here https://www.image-map.net/

I search for libraries but nothing that I can really use. Here is lib for angularJS, but can not use it in angular 2+.

With 'hard-coded' coordinates it is ok, but I need to create them dynamically (user will drow area) Thnx

<!DOCTYPE html>
<html>
<body>

<h2>Image Maps</h2>
<p>Click on the computer, the phone, or the cup of coffee</p>

<img src="https://www.w3schools.com/html/workplace.jpg" alt="Workplace" usemap="#workmap" width="400" height="379">

<map name="workmap">
  <area shape="rect" coords="34,44,270,350" alt="Computer" onclick="myFunction('Computer')">
  <area shape="rect" coords="290,172,333,250" alt="Phone" onclick="myFunction('Phone')">
  <area shape="circle" coords="337,300,44" alt="Cup of coffee" onclick="myFunction('Cup')">
</map>

</body>
</html>

<script>
function myFunction(item) {
  alert(item);
}
</script>
Arter
  • 2,224
  • 3
  • 29
  • 66

0 Answers0