Link to home
Start Free TrialLog in
Avatar of XGIS
XGISFlag for Australia

asked on

How do I get a functional KML file to display on GoogleMap API v3

The available GoogleMaps javascript samples do not allow me to display a KML file as a selectable controlled by checkbox selection.  Also is it possible to use relative paths instead of urls.

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://earth.google.com/kml/2.0"> <Document>
<Placemark> 
<name>MGAZ54</name>
 <Polygon>   
 <altitudeMode>absolute</altitudeMode>
  <outerBoundaryIs>  <LinearRing>
  <coordinates>
   138, -28, 0. 
   144, -28, 0.
   144, -38.5, 5000.
   138, -38.5, 10000.
  </coordinates>
 </LinearRing> </outerBoundaryIs> </Polygon>
 <Style> 
  <PolyStyle>  
   <color>#000</color>
  <outline>1</outline>
  </PolyStyle> 
 </Style>
</Placemark>
<Placemark> 
<name>MGAZ55</name>
 <Polygon>   
 <altitudeMode>absolute</altitudeMode>
  <outerBoundaryIs>  <LinearRing>
  <coordinates>
   144, -28, 0. 
   150, -28, 0.
   150, -38.5, 5000.
   144, -38.5, 10000.
  </coordinates>
 </LinearRing> </outerBoundaryIs> </Polygon>
 <Style> 
  <PolyStyle>  
   <color>#000</color>
  <outline>1</outline>
  </PolyStyle> 
 </Style>
</Placemark> 
<Placemark> 
<name>MGAZ56</name>
 <Polygon>   
 <altitudeMode>absolute</altitudeMode>
  <outerBoundaryIs>  <LinearRing>
  <coordinates>
   150, -28, 0. 
   156, -28, 0.
   156, -38.5, 5000.
   150, -38.5, 10000.
  </coordinates>
 </LinearRing> </outerBoundaryIs> </Polygon>
 <Style> 
  <PolyStyle>  
   <color>#000</color>
  <outline>1</outline>
  </PolyStyle> 
 </Style>
</Placemark> 
</Document> 
</kml>

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of XGIS
XGIS
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of XGIS

ASKER

Eliminates need for kml