title: Tooltip over a Polygon in Google Maps
body: <p>I have polygons for various region and states in my application. Markers implement tooltip by taking the title attribute. On mouseover and mouseout over a polygon events can be fired. How do I create a tooltip that looks like the tooltip that is implemented for a marker.</p>
  
  <p>Edit-1: Adding the code used to create the polygon and attach the handlers to show/hide tooltips.</p>
  
  <pre><code>function addPolygon(points) {
      var polygon = new google.maps.Polygon({
          paths: points,
          strokeColor: " #FFFFFF",
          strokeOpacity: 0.15,
          strokeWeight: 1.5,
          fillColor: "#99ff66",
          fillOpacity: 0.14
      });
      var tooltip = document.createElement('div');
      tooltip.innerHTML = "Alok";
  
      google.maps.event.addListener(polygon,'mouseover',function(){
          tooltip.style.visibility = 'visible';
      });
      google.maps.event.addListener(polygon,'mouseout',function(){
          tooltip.style.visibility = 'hidden';
      });
      polygon.setMap(map);
  }
  </code></pre>