You have tried the following "click" event properties: screen/clientX and screen/clientY?
Instead of placing button-like elements in the image, Oce only compares the click coordinate with the image ugar coordinate that Oce considers a "clickable" region to show the modal.
Using clientX and clientY Voce get the DOM coordinates where the click was, this way Voce can display the modal with the following logic:
handleImageClick(event){
let x = event.clientX;
let y = event.clientY;
// Coordenadas
if (x === coord_modal1_x && y === coord_modal1_y) {
// mostre o modal 1
}
}
Note: the coordinates are long type, so turn the "clickable" coordinates to long.
Reference: https://developer.mozilla.org/en-US/docs/Web/Events/click
See if this is what you want: http://www.emanueleferonato.com/2006/09/02/click-image-and-get-coordinates-with-javascript In this example you can get the strings
– Pedro Silva
Thank you so much for the help, but I can’t depend on the click to know the coordinate, I need to load the page with the buttons already positioned
– Otavio Souza Rocha