Update map.js

Little improvement to avoid the loop on each tr