I only know that it relies on the map through experimentation when I was working on an addon that used encounter journal functions.
I tried a few maps without EJ bosses on them and they all return 0 for the instance, then when I opened the map to valley of the four winds it returned 322 because it has a world boss on it.