You can multiply the coordinates by the ratio of the original image and the styled image.
<img id="paredea" usemap="#PAREDE-A" src="https://i.imgur.com/o9nrUMR.png">
<map name="PAREDE-A">
<area id="paredea0" shape="rect" onclick="alert('colmeia A')">
<area id="paredea1" shape="rect" onclick="alert('colmeia B')">
<area id="paredea2" shape="rect" onclick="alert('colmeia C')">
<area id="paredea3" shape="rect" onclick="alert('colmeia D')">
<area id="paredea4" shape="rect" onclick="alert('colmeia E')">
<area id="paredea5" shape="rect" onclick="alert('comeia F')">
<area id="paredea6" shape="rect" onclick="alert('colmeia G')">
<area id="paredea7" shape="rect" onclick="alert('colmeia H')">
<area id="paredea8" shape="rect" onclick="alert('colmeia I')">
<area id="paredea9" shape="rect" onclick="alert('colmeia J')">
<area id="paredea10" shape="rect" onclick="alert('colmeia K')">
<area id="paredea11" shape="rect" onclick="alert('colmeia L')">
<area id="paredea12" shape="rect" onclick="alert('colmeia M')">
<area id="paredea13" shape="rect" onclick="alert('colmeia N')">
<area id="paredea14" shape="rect" onclick="alert('colmeia O')">
</map>
<script>
var coordsA = [];
coordsA[0] = "0,0,200,130";
coordsA[1] = "200,0,400,130";
coordsA[2] = "400,0,600,130";
coordsA[3] = "600,0,800,130";
coordsA[4] = "800,0,1000,130";
coordsA[5] = "0,160,200,240";
coordsA[6] = "200,160,400,240";
coordsA[7] = "400,160,600,240";
coordsA[8] = "600,160,800,240";
coordsA[9] = "800,160,1000,240";
coordsA[10] = "0,270,200,400";
coordsA[11] = "200,270,400,400";
coordsA[12] = "400,270,600,400";
coordsA[13] = "600,270,800,400";
coordsA[14] = "800,270,1000,400";
function setcoords(areaid, totalOfAreas) {
document.getElementById('paredea').style.width = "auto";
var width1 = document.getElementById('paredea').width;
document.getElementById('paredea').style.width = "100%";
var width2 = document.getElementById('paredea').width;
var ratio = width2 / width1;
for (var i = 0; i < totalOfAreas; i++) {
var temp = coordsA[i].split(",");
var newcoords = "";
for (var j = 0; j < temp.length; j++) {
temp[j] *= ratio;
newcoords += temp[j] + ",";
}
newcoords = newcoords.substr(0, newcoords.length - 1);
document.getElementById(areaid + i).coords = newcoords;
}
}
window.onload = function () {
setcoords("paredea", 15);
};
window.onresize = function () {
setcoords("paredea", 15);
};
</script>
IMG
which won't resize according to the window, and now you want aMAP
which always will cover only the visible part of theIMG
? – Risteau