2013-01-04 83 views

回答

2

你必须嵌入一个CDATA块中的HTML中,则说明它的工作原理。

注意:您还应该为您的KML添加一个片段元素并附带简短描述,以便在展示位置面板中不呈现完整的HTML。

工作例子是这样的:关于KML,包括限制描述元素都可以在这里找到

<?xml version="1.0" encoding="UTF-8"?> 
<kml> 
<Placemark> 
    <snippet>Click to see embedded chart</snippet> 

    <description> 
<![CDATA[ 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
    <title>Google Visualization API Sample</title> 
    <script type="text/javascript" src="http://www.google.com/jsapi"></script> 
    <script type="text/javascript"> 
    google.load('visualization', '1', {packages: ['motionchart']}); 

    function drawVisualization() { 

     var time = [['2000W01', '2000W02'], 
        ['2002Q3', '2002Q4'], 
        [1990, 1991], 
        [(new Date(2000, 0, 1)), (new Date(2000, 0, 2))]]; 

    // ... rest of HTML/javascript truncated 
    // full HTML found here: 
    // https://code.google.com/apis/ajax/playground/?type=visualization#motion_chart_time_formats 

    <div id="visualization" style="width: 800px; height: 400px;"></div> 
    </body> 
</html> 
]]> 
    </description> 

    <Point> 
      <coordinates>-122.087461,37.422069</coordinates> 
    </Point> 
    </Placemark> 
</kml> 

详细信息。 https://developers.google.com/kml/documentation/kmlreference#description