2014-02-23 58 views
0

我已經在過去的幾個小時裏瀏覽了這段代碼,我不知道爲什麼它不起作用。它一直在工作,直到我開始添加更多的地點標記。當我通過KML驗證器運行它時,出現以下錯誤:「無法從xxxx.kml讀取內容。文件格式和字符編碼是否正確?」KML沒有加載到谷歌地圖API v3

有誰知道我在做什麼錯?

<?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

基本上KML是XML。在XML中,&只能用於定義字符實體引用。當你想使用&的字符,你必須對其進行編碼,作爲&amp;

您的KML中包含多個非編碼&

您可以輕鬆通過給它的任何擴展.xml打開它驗證KML爲XML瀏覽器。當有XML錯誤時,瀏覽器會給你一條消息。

+0

感謝您的配偶!工作過一種享受 –