xpda
xpda

Reputation: 15813

How can you use transparency in a kml/kmz file on Google Maps API?

I'm testing an embedded Google Map with a kml or kmz file, and cannot get any transparency. The kml / png shows transparency in Google Earth, but not in Google Maps. The first color byte in the kml file (<color>88ffffff</color>) has no effect on the transparency.

Is there a way to get the transparency in Google Maps as well as Google Earth?

function initialize() {
  var mapProp = {
    center: new google.maps.LatLng(36.31, -95.37),
    zoom: 11,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  };
  var map = new google.maps.Map(document.getElementById("googleMap"), mapProp);
  var kmzLayer = new google.maps.KmlLayer('http://xpda.com/coverage.kml');
  kmzLayer.setMap(map);
}  
google.maps.event.addDomListener(window, 'load', initialize);

Upvotes: 1

Views: 2165

Answers (1)

Dr.Molle
Dr.Molle

Reputation: 117314

KML-Layers in Google Maps does not support the <color>-element for GroundOverlays.

You may store the PNG with the desired alpha-transparency instead.

Upvotes: 1

Related Questions