// Apply stylemap to a placemark
var styleMap = ge.createStyleMap('');
// Create normal style for style map
var normalStyle = ge.createStyle('');
var normalIcon = ge.createIcon('');
normalIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/triangle.png');
normalStyle.getIconStyle().setIcon(normalIcon);
// Create highlight style for style map
var highlightStyle = ge.createStyle('');
var highlightIcon = ge.createIcon('');
highlightIcon.setHref('http://maps.google.com/mapfiles/kml/shapes/square.png');
highlightStyle.getIconStyle().setIcon(highlightIcon);
styleMap.setNormalStyle(normalStyle);
styleMap.setHighlightStyle(highlightStyle);
// Apply stylemap to a placemark
placemark.setStyleSelector(styleMap);