Should cache opts.useMapControls in a local variable (outside of the loop) to save on repeated object accesses.