2015-02-24 96 views
3

我有一個讓我瘋狂兩天的問題。低分辨率KML GroundOverlay

我們有一個Google地圖應用程序,它可以提取KML文件以顯示歷史地圖作爲圖像疊加層。大約在上週,我們的應用程序開始顯示非常模糊的圖像,這些圖像是從我們自己的googleusercontent服務器中提取的。更令人費解的是,Google緩存中的圖像與我服務器上的圖像大小不同 - 它們的尺寸比我的服務器小三倍。

我沒有任何運氣迫使Google不在他們的緩存中使用該文件的版本。當我更改文件的名稱或目錄時,我會從googleusercontent網址獲取404錯誤,但它不會加載正在引用的實際鏈接。

以下是一個示例KML文件(從Google地球導出)。該圖像與KML文件位於同一目錄中。

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://www.opengis.net/kml/2.2" xmlns:gx="http://www.google.com/kml/ext/2.2" xmlns:kml="http://www.opengis.net/kml/2.2" xmlns:atom="http://www.w3.org/2005/Atom"> 
<GroundOverlay> 
    <name>panel1</name> 
    <Icon> 
      <href>panel1.png</href> 
      <viewBoundScale>0.75</viewBoundScale> 
    </Icon> 
    <LatLonBox> 
      <north>37.5422476694301</north> 
      <south>37.53370251727466</south> 
      <east>-77.43246990568036</east> 
      <west>-77.44384562932868</west> 
    </LatLonBox> 
</GroundOverlay> 
</kml> 

以下是我在地圖上加載KMLOverlay的調用。

this.GOOGLE_MAP = new google.maps.Map(document.getElementById('richmond_map'),{ 
     center: new google.maps.LatLng(<lat_value>, <lng_value>), 
     zoom:16, 
     streetView: new google.maps.StreetViewPanorama($('#street')[0],{disableDefaultUI: true}) 
    }); 

    var d = new Date(); 
    this.OVERLAY = new google.maps.KmlLayer({url: <url_to_KML_file>, clickable: false, map: this.GOOGLE_MAP, preserveViewport: true, zIndex:2 }); 

回答