日期:2014-05-17  浏览次数:20949 次

google map api地面叠加层不能显示网络图片
C# code

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
  html { height: 100% }
  body { height: 100%; margin: 0px; padding: 0px }
  #map_canvas { height: 100% }
</style>
<script type="text/javascript"
    src="https://ditu.google.com/maps/api/js?sensor=true">
</script>
<script type="text/javascript">
    function initialize() {
        var newark = new google.maps.LatLng(40.740, -74.18);
        var imageBounds = new google.maps.LatLngBounds(
    new google.maps.LatLng(40.716216, -74.213393),
    new google.maps.LatLng(40.765641, -74.139235));

        var myOptions = {
            zoom: 13,
            center: newark,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        }

        var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

        var oldmap = new google.maps.GroundOverlay("http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg",imageBounds);
        oldmap.setMap(map);
    }
    google.maps.event.addDomListener(window, 'load', initialize);

</script>
</head>
<body>
  <div id="map_canvas" style="width:100%; height:100%"></div>
</body>
</html>


想在地图上面加一个叠加层,图片"http://www.lib.utexas.edu/maps/historical/newark_nj_1922.jpg"可通过网络访问,但是不能加载到地图上;但是如果把图片保存到文件夹里边,通过"image3/img"可以正常加载。这是怎么回事哦?求解!

------解决方案--------------------
IE7,IE8,firefox4.0都可以加载,没问题