Google Maps marker text not appearing


I have this Google Map code in which I want to display a simple pointer and text, but the text is not appearing.
Any ideas why?


function initialize() {
  var myLatlng = new google.maps.LatLng(48.89364, 2.33739);
  var mapOptions = {
    zoom: 13,
    center: myLatlng
  var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);

  var marker = new google.maps.Marker({
      position: myLatlng,
      map: map,
      title: 'Hello World!'

google.maps.event.addDomListener(window, 'load', initialize);

Some things to check:

  • have you linked to the Google Maps api on the same page (and above the code you posted)?
  • have you placed a container on the page with an ID of ‘map-canvas’?


Yes I have it included and also using a div with the id of map-canvas.

Any other ideas?

When you say the text is not appearing, what are you expecting to happen? The marker is given a title attribute of “Hello World”. Titles appear when you hover over a marker. Your code does that.