Sweltering summer temperatures are increasingly common, especially in cities where closely packed buildings and paved surfaces trap heat.