Use map.on instead of map.addEventListener