|
|
|
|
|
by kevsim
2219 days ago
|
|
I feel like I'm missing something. It seems like declare a <map> element, associate it with an <img>, but then use JS to iterate over the map and build a bunch of absolutely positioned <div> elements on top of the image. Why not just have the annotations stored outside the DOM (returned by API or whatever) and just build the absolutely positioned <div> elements? Wouldn't that avoid the fighting with funky coordinate systems, etc.? I get why <map> is (was?) useful in general, but if you're going to do your own annotation rendering on top anyway, it just seems odd. Fun exercise though! |
|
However... image maps also allow for circular and polygonal regions, which can be really handy.
I guess you could also do that with a transparent SVG overlay, but using a map is easier.