bad idea :) This prevents the block to be safely used twice in the same page.
Solutions: either restore the old naming or enclose this whole code in a self inoking anonymous function to make gmapDataArray not global anymore.