title: Google maps get marker icon url on click
body: <p>I need to get marker icon url on click, I saw on google maps documentation that there is function getIcon() but don't know where to call it.</p>
  
  <pre><code>  google.maps.event.addListener(layer, 'click', function (kmlEvent) {
                      alert(kmlEvent.getIcon());//Object #&lt;Object&gt; has no method 'getIcon'
                      showInContentWindow(map, kmlEvent);
                  });
  </code></pre>
  
  <p><strong>Update:</strong></p>
  
  <pre><code>    var myOptions = {
          zoom: 8,
          center: null,
          mapTypeId: google.maps.MapTypeId.ROADMAP
      };
  
      var map = new google.maps.Map(document.getElementById("kmlMapCanvas"), myOptions);
  
      var layer = new google.maps.KmlLayer(
      'https://maps.google.co.uk/maps/ms?msid=207817312541605896974.0004cdbf70e9c541de0ac&amp;msa=0&amp;ll=51.499019,-0.58382&amp;spn=0.070103,0.209255&amp;output=kml',
      {                       
        suppressInfoWindows: true,
        map: map
      });
  
      google.maps.event.addListener(layer, 'click', function (kmlEvent) {
               alert(kmlEvent.getIcon());//Object #&lt;Object&gt; has no method
          showInContentWindow(map, kmlEvent);
      });
  </code></pre>
  
  <p>where I am losing connection with native marker....</p>