I followed the Google\'s example here. The JavaScript begins like the following (I put it in a function to call it later in other ways):
function initMap() {