如何将 KML 多边形转换为 'mask' 等效实体?

How can i transform KML polygons in their 'mask' equivalent entities?

我有 KML 文件,我想并且我想将世界其他地方显示为灰色,只显示我的国家。但是 KML 也没有显示,我该怎么做 http://www.vasile.ch/hacks/ft-mask/

KML File

function initMap() {
   var myLatLng = {lat: 19.0760, lng: 72.8777};    
   var map = new google.maps.Map(document.getElementById('map-canvas'), {
       zoom: 5,
       center: new google.maps.LatLng(22.4913, 78.9000),
       mapTypeId: google.maps.MapTypeId.ROADMAP,
       disableDefaultUI: true      
   }); 
   var geocoder = new google.maps.Geocoder();
   var geoXml = new geoXML3.parser({
       map: map,
       singleInfoWindow: false,        
   });
   geoXml.parse('India_KML.kml'); 
   google.maps.event.addListener(geoXml,'parsed', function() {
       geocoder.geocode( { 'address': "India"},function(results, status) {
           if (status == google.maps.GeocoderStatus.OK) {
               map.fitBounds(results[0].geometry.viewport);
           } else {
               alert("Geocode was not successful for the following reason: " + status);
           }
       });    
   })
}
window.onload = initMap;
#map-canvas { 
  height: 100%; 
  width: 100%; 
  position:absolute; 
  top: 0; 
  left: 0; 
  z-index: 0;
  zoom:0.8;
}  
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?region=IN&libraries=places"></script>

<div id="map-canvas"></div>

来自链接的副本:How to invert KML so that area outside of polygon is highlighted:

Change your KML. Add an outer boundary to the polygon that covers the whole world. Make sure the winding direction of the outer polygon is opposite the winding direction of the inner polygon.

<kml xmlns='http://www.opengis.net/kml/2.2'>
    <Document>      
        <Folder>            
            <Placemark>             
                <styleUrl>#poly-A52714-1-77</styleUrl>

                <Polygon>
<outerBoundaryIs><LinearRing><coordinates>180,85 180,0 180,-85 90,-85 0,-85 -90,-85 -180,-85 -180,0 -180,85 -90, 85 0,85 90, 85 180,85
<!--
180,85 90,85 0,85 -90,85 -180,85 -180,0 -180,-85 -90,-85 0,-85 90,-85 180,-85 180,0 180,85 
-->
</coordinates></LinearRing></outerBoundaryIs>
<innerBoundaryIs>
                        <LinearRing>                            
                            <coordinates>
                               73.6523438,36.8796206,0.0 73.125,36.7036596,0.0 <!-- ... snip -->
                            </coordinates>
                        </LinearRing>
</innerBoundaryIs>
                </Polygon>
            </Placemark>
        </Folder>
<!-- snip -->
    </Document>
</kml>

example with "fixed" KML