maphilight icon indicating copy to clipboard operation
maphilight copied to clipboard

don't run if <map> has no <area>

Open vladkras opened this issue 9 years ago • 0 comments

In one of my projects tag is sometimes empty. So I don't need the to be generated.

Maybe add some default option like 'emptyMap': true for backward compatibility, so it could be disabled on startup if desired.

Possible solution:

// if map has no descendant areas and option is set to false
if (!map.has('area').length && !option.emptyMap) {
    return
}

somewhere near line 235 of http://davidlynch.org/projects/maphilight/jquery.maphilight.js

vladkras avatar Oct 21 '15 18:10 vladkras