# Google Map API v3 Help Needed

**URL:** <https://forum.kirupa.com/t/google-map-api-v3-help-needed/328630>\
**Category:** web dev\
**Created:** [May 31, 2012, 7:14pm UTC](https://forum.kirupa.com/t/google-map-api-v3-help-needed/328630 "2012-05-31T19:14:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vanss472](https://avatars.discourse-cdn.com/v4/letter/v/c77e96/32.png) [@Vanss472](https://forum.kirupa.com/u/Vanss472)\
**Post date:** [May 31, 2012, 7:14pm UTC](https://forum.kirupa.com/t/google-map-api-v3-help-needed/328630/1 "2012-05-31T19:14:56Z")

</div>

Hi I have this code on my javascript file that add a marker to a google map and i want an **info window** to appear when positioning the marker. Any one can help me accomplish this.

Thanks

```auto

var marker;   
     
function addMarker(location) {
  if ( marker ) {
    marker.setPosition(location);
  } else {
    marker = new google.maps.Marker({
     position: location,
     map: map,
     icon: imageBlue,
     draggable: true
    });
  }
  markersArray.push(marker);
}
  
google.maps.event.addListener(map, 'click', function(event) {
    addMarker(event.latLng);
  });
  
 google.maps.event.addListener(marker, 'click', function() {
   dragInfoWindow.open(map,marker);
});
dragInfoWindow.open(map,marker);

```
