0

我使用 geoxml3 的 kmz 分支从 kmz 文件中简单地渲染地理日期。但效果不好。地标渲染得很好,但我看不到任何叠加层。这是我的代码:

    $doc->addScript($this->baseurl.'/components/com_google_map/assets/ZipFile.complete.js', 'text/javascript');
    $doc->addScript($this->baseurl.'/components/com_google_map/assets/geoxml3.js', 'text/javascript');
    $doc->addScript($this->baseurl.'/components/com_google_map/assets/ProjectedOverlay.js');
    <script type="text/javascript">
        google.load("earth", "1");
        var myMap;
        var minZoomLevel = 3;
        var geoXml;
          function initialize() {
            var mapOptions = {
              center: new google.maps.LatLng(55.01, 82.85),
              zoom: 8,
              mapTypeId: google.maps.MapTypeId.ROADMAP
            };
            myMap = new google.maps.Map(document.getElementById("map_canvas"),
                mapOptions);
            geoXml = new geoXML3.parser({map: myMap, afterParse: showGeoData});
            geoXml.parse('/components/com_google_map/soil_moisture/soil.zip');
          }
          function showGeoData(doc) {
                console.log(doc);
                geoXml.showDocument(doc);
        };
    </script>

这是kml:

<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
  <name>Soil_Moisture</name>
  <description>Retrieved soil moisture value
SM_OPER_MIR_SMUDP2_20120916T130233_20120916T135546_551_001_1</description>
  <GroundOverlay>
    <name>Raster data</name>
    <visibility>1</visibility>
    <LatLonBox>
      <north>90.0</north>
      <south>-90.0</south>
      <east>180.0</east>
      <west>-180.0</west>
      <rotation>0</rotation>
    </LatLonBox>
    <Icon>
      <href>overlay.png</href>
    </Icon>
  </GroundOverlay>
  <ScreenOverlay>
    <name>Legend</name>
    <Icon>
      <href>legend.png</href>
    </Icon>
    <overlayXY x="0" y="1" xunits="fraction" yunits="fraction" />
    <screenXY x="0" y="1" xunits="fraction" yunits="fraction" />
  </ScreenOverlay>
</Document>
</kml>

这两个 png 文件都包含在 kmz 中。并且控制台中没有错误或警告。有人可以帮忙吗?

PS对不起我的英语。

4

0 回答 0