KML没有加载到谷歌地图API v3

时间:2014-02-23 01:19:42

标签: google-maps-api-3 kml

过去几个小时我已经查看了这段代码,我无法弄清楚它为什么不起作用。它一直在工作,直到我开始添加更多的地方标记。当我通过KML验证器运行它时,我收到以下错误“无法从xxxx.kml读取内容。文件格式和字符编码是否正确?”

有谁知道我做错了什么?

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://www.opengis.net/kml/2.2">
<document>
<Placemark>
<name>The Stables Bar</name>
<description>888 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.853097,-31.952223,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Laneway Lounge</name>
<description>414A Murray Street Perth WA 6000</description>
<Point>
<coordinates>115.853839,-31.951099,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Choo Choo's</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854628,-31.954883,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Apple Daily</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854738,-31.954855,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar de Halcyon</name>
<description>Wolf Lane Perth, WA 6000</description>
<Point>
<coordinates>115.855933,-31.952619,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bob's Bar at Print Hall</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.855170,-31.954918,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar Lafayette</name>
<description>125 St Georges Terrace, Perth, Western Australia 6000</description>
<Point>
<coordinates>115.854679,-31.954819,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>1907 Restaurant and Cocktail Bar</name>
<description>26 Queen St, Perth</description>
<Point>
<coordinates>115.856590,-31.951334,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Lalla Rookh</name>
<description>77 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.858371,-31.955540,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bar One</name>
<description>250 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.850572,-31.952616,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Cheeky Sparrow</name>
<description>Shop 1/317 Murray St Perth WA 6000</description>
<Point>
<coordinates>115.855964,-31.952298,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Sasellas Bar & Bistro</name>
<description>Upper Hay Street Level, Carillon City Arcade, Perth WA 6000</description>
<Point>
<coordinates>115.858865,-31.953137,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Sentinel Bar & Grill Restaurant</name>
<description>111 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.855805,-31.954909,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Boheme</name>
<description>300 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.857400,-31.952189,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Conservatory Rooftop Bar</name>
<description>365 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.854993,-31.951568,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Greenhouse</name>
<description>100 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.857670,-31.954887,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Trustee Bar and Bistro</name>
<description>133 St Georges Tce, Perth WA 6000</description>
<Point>
<coordinates>115.855176,-31.954423,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Tiger,Tiger</name>
<description>329 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.855975,-31.952062,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Venn Bar + Cafe</name>
<description>16 Queen St, Perth WA 6000</description>
<Point>
<coordinates>115.856495,-31.951748,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Wolf Lane Bar</name>
<description>Wolf Lane 321 Murray St, Perth WA 6000</description>
<Point>
<coordinates>115.855748,-31.952510,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Butterworth Bar & Kitchen</name>
<description>Ground Floor, Exchange Plaza, Perth WA 6000</description>
<Point>
<coordinates>115.858659,-31.956595,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Canton Lounge Bar</name>
<description>532 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.862666,-31.955345,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Etro Bar</name>
<description>49 King St, Perth WA 6000</description>
<Point>
<coordinates>115.855095,-31.951920,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Varnish on King</name>
<description>75 King St, Perth WA 6000</description>
<Point>
<coordinates>115.855543,-31.950993,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Lost Society</name>
<description>918 Hay St, Perth WA 6000</description>
<Point>
<coordinates>115.852335,-31.951861,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Mechanic Institute</name>
<description>222 William St, Northbridge WA 6000</description>
<Point>
<coordinates>115.859842,-31.948820,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Universal Bar</name>
<description>221 William St, Perth WA 6003</description>
<Point>
<coordinates>115.859543,-31.948670,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Frisk Small Bar</name>
<description>31/103-105 Francis St, Perth WA 6003</description>
<Point>
<coordinates>115.856724,-31.946700,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Pica Bar and Cafe</name>
<description>Perth Cultural Centre, James St, Northbridge WA 6000</description>
<Point>
<coordinates>115.860328,-31.949734,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Ellington Jazz Club</name>
<description>191 Beaufort St, Perth WA 6000</description>
<Point>
<coordinates>115.864292,-31.946683,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Moon Cafe</name>
<description>Shop 2/323 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.861155,-31.946033,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Brown Fox</name>
<description>72 Outram St, West Perth WA 6005</description>
<Point>
<coordinates>115.840356,-31.947353,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Hula Bula Bar</name>
<description>12 Victoria Ave, Perth WA 6000</description>
<Point>
<coordinates>115.865790,-31.956914,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Andaluz Bar & Tapas</name>
<description>321 Howard St, Perth WA 6000</description>
<Point>
<coordinates>115.857228,-31.955534,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Ezra Pound</name>
<description>189 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.858998,-31.949364,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Bird</name>
<description>181 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.858844,-31.949706,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The George</name>
<description>216 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.852535,-31.953275,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Amphoras Bar</name>
<description>1303 Hay St, West Perth WA 6005</description>
<Point>
<coordinates>115.839396,-31.947948,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Ya-Ya's</name>
<description>147 James St, Northbridge WA 6003</description>
<Point>
<coordinates>115.856888,-31.948061,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bivouac Canteen & Bar</name>
<description>198 William St, Northbridge WA 6003</description>
<Point>
<coordinates>115.859211,-31.949395,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Bobeche</name>
<description>131 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.855194,-31.954401,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>The Aviary</name>
<description>1/140 William St, Perth, WA 6000</description>
<Point>
<coordinates>115.857878,-31.952255,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>399 Bar</name>
<description>399 William St, Perth WA 6000</description>
<Point>
<coordinates>115.862158,-31.944359,0</coordinates>
</Point>
</Placemark>
<Placemark>
<name>Helvetica Bar</name>
<description>101 St Georges Terrace, Perth WA 6000</description>
<Point>
<coordinates>115.856947,-31.955478,0</coordinates>
</Point>
</Placemark>
</document>
</kml>

1 个答案:

答案 0 :(得分:1)

基本上KML是XML。在XML中&amp;可能只用于定义字符实体引用。如果要将&用作字符,则必须将其编码为&amp;

您的KML包含多个非编码&

您可以通过为其添加扩展名.xml并在任何浏览器中打开它来轻松验证KML为XML。当存在XML错误时,浏览器会给您一条消息。