Even though mapcoords() is called immediately from the script of this module it never sets the data-coords attribute of the area elements, when the page first loaded. Since my width is small the img height is scaled but the map coordinates are not synced to the smaller image size.
If I rotate the device (after the page has been displayed) and trigger a window resize, then data-coords gets set and the sync is working. It seems that when a new page is loaded, invoking mapcoords() before the map is available causes this behaviour.
Even though
mapcoords()
is called immediately from the script of this module it never sets thedata-coords
attribute of the area elements, when the page first loaded. Since my width is small theimg
height is scaled but the map coordinates are not synced to the smaller image size.If I rotate the device (after the page has been displayed) and trigger a window resize, then
data-coords
gets set and the sync is working. It seems that when a new page is loaded, invokingmapcoords()
before themap
is available causes this behaviour.