Risky (area-based) maps and HTML / JavaScript

Let's say we have a risk map, similar to a ritual, which is divided into areas of the user form.

How to allow user to select a specific region using HTML5 / JavaScript? I guess Canvas2D is the first step, but what then?

Dominategame

+4
source share
2 answers

You can create a map tag, which you then add to your img tag. In your map tag, you define different areas that the user can click into. You can then define javascript functions to call the mousedown event of each scope.

I do not like the explanation, I prefer examples! So, here is the link I just found that better describes this technique:

http://www.tutorialspoint.com/javascript/javascript_image_map.htm

And by the way, you do not need to manually create areas. There are many WYSIWYG tools out there that will create it for you!

+2
source

Source: https://habr.com/ru/post/1488518/


All Articles