Q:

How to change the icon on google map, while the layer is import by kml file?

I've been trying to solve this question for a week, and haven't found any solution yet.
All I found is marker that is placed by one's own can be changed.
My situation is I import a KML file with some marker,and I want to change the icon on click event.
The code below works fine  
    var ctaLayer = new google.maps.KmlLayer({
            //KMZ KML
            url: url,
            map: map,
            suppressInfoWindows: true,
         });
    ctaLayer.addListener('click', function (kmlEvent) {     
    var text = kmlEvent.featureData.description;  
    showInContentWindow(text); }

My Current Result
Most People use the below function to set different icon
marker.seticon(ICON)

But in my case I can't get the marker I click
Hope someone can help me!!

A:

With KmlLayer you can't change the style after load (with the API as currently documented).  One option would be to use a third party KML parser (like geoxml3 or geoxml_v3) which converts KML into native google maps api objects, which you can change.
geoxml3:
https://github.com/geocodezip/geoxml3
geoxml_v3:
http://code.google.com/p/geoxml-v3/

