Coordinates not accurate after browser resize
Closed this issue · 1 comments
I have a feeling I'm doing something wrong, but for me the area coordinates are not working after resizing the window (or after refreshing the page after resizing the window). It seems to be behaving as if still using the original coordinates.
Here is my img:
<img usemap="#usa" width="794px" height="491px" typeof="foaf:Image" src="/map.jpg" alt="" />
And here is the map with on example area:
<map name="usa"><area title="LA" shape="poly" coords="482,394,481,392,481,389,477,386,478,380,478,380,477,380,470,380,451,381,450,380,451,373,453,368,457,361,457,360,457,360,458,357,457,356,457,354,455,351,455,346,446,346,431,346,413,346,413,354,414,362,414,365,416,368,417,372,420,376,420,379,421,380,420,386,418,390,419,392,419,394,419,400,417,403,418,405,421,404,428,404,436,407,441,408,444,407,447,408,449,409,450,407,448,406,445,406,443,404,448,404,449,404,452,404,452,406,452,408,457,408,458,409,457,410,457,411,457,413,464,415,467,414,468,412,470,412,472,410,472,411,473,413,472,414,472,415,475,413,477,411,477,411,475,410,476,409,476,408,477,408,478,407,479,407,486,412,486,413,489,413,490,413,491,411,491,410,491,410,488,408,483,407,481,405,481,404,483,404,484,403,482,402,482,402,485,402,486,399,486,398,485,395,484,395,482,398,481,399,479,399,478,398,480,396,481,394,482,394">
After loading the jquery.mapify.js and jquery.mapify.css, and doing $("img[usemap]").mapify();
I get no errors and see "mapified" in the console. But, when I resize the window, although the image shrinks with the browser, the coordinates are no longer correct.
Thank you for any advice!
Ah, update: giving the map an id of "usa" solved it. Previously I only had a name of "usa". Sorry for the noise.