Хочу добавить infowindow с поточным адресом местоположения. Использую cordova. Когда добавляю обычным способом как в документации гугл 
var marker = new google.maps.Marker({
      position: myLatlng,
      map: map,
      title: 'Uluru (Ayers Rock)'
  });
  google.maps.event.addListener(marker, 'click', function() {
    infowindow.open(map,marker);
  })
маркер отображается, но на клик не реагирует. В идеале должно отображаться с помощью функции settimeout, но тоже не работает.
Подскажите, в чем проблема. Спасибо
<html>
    <head>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <!-- WARNING: for iOS 7, remove the width=device-width and height=device-height attributes. See https://issues.apache.org/jira/browse/CB-4323 -->
        <meta name="viewport" content="user-scalable=no, initial-scale=1, maximum-scale=1, minimum-scale=1, width=device-width, height=device-height, target-densitydpi=device-dpi" />
        <link rel="stylesheet" type="text/css" href="css/index.css" />
        <meta name="msapplication-tap-highlight" content="no" />
        <link rel="stylesheet" href="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.css" />
        <script src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
        <script src="http://code.jquery.com/mobile/1.4.3/jquery.mobile-1.4.3.min.js"></script>
        <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=true"></script>
        <script type="text/javascript" src="cordova.js"></script>
        
        <title>TestMap</title>
        <script type="text/javascript">
            function onLoad() {
                document.addEventListener("deviceready", onDeviceReady, false);
            }
            function onDeviceReady() {
                navigator.geolocation.getCurrentPosition(onSuccess, onError);
            }
            //GEOLOCATION
            var onSuccess = function(position) {
                var myLat = position.coords.latitude;
                var myLong = position.coords.longitude;
                var pos = new google.maps.LatLng(myLat, myLong);
                //MAP
                var mapOptions = {
                    center: pos,
                    zoom: 14,
                    mapTypeId: google.maps.MapTypeId.ROADMAP
                };
                var map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
                
                var contentstr = '<h3>latitude</h3>';
                var infowindow = new google.maps.InfoWindow({
                    content: contentstr
                });
                
                var marker = new google.maps.Marker({
                    position: pos,
                    map: map,
                    title: 'i am here'
               });
          
            };
            // onError Callback receives a PositionError object
            //
            function onError(error) {
                alert('code: '    + error.code    + '\n' +
                        'message: ' + error.message + '\n');
            }
    </script>
    </head>
    
    <body onload="onLoad()">
        <h3>TestMap</h3>
        <div id="map_canvas" style="width:400px; height: 400px;"></div>
    </body>
</html>