-1

是的,我已经阅读了大量关于标记未在 IE6、7、8 等中显示的帖子——我也尝试了更高版本。

问题是它有时会显示,有时则不会。

我正在使用 Internet Explorer ActiveX 控件在 Win32 应用程序 XP SP2 中显示带有标记的地图。

我试过 MarkerManager,没有运气。也尝试更改安全选项。

无论如何,这里是代码......任何新的想法将不胜感激。谢谢你。

<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=yes" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false&language=en"></script>
<script type="text/javascript">
  var geocoder;
  var map;
  var AllOtherUnits = [];
  var MyUnit;
  var currentMarker;
  var OtherUnit;

  function initialize(Lat, Lng) {
    geocoder = new google.maps.Geocoder();
    var latlng = new google.maps.LatLng(Lat, Lng);
    var myOptions = {
      zoom: 13,
      center: latlng,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    };
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    map.set("streetViewControl", false);
  }

  function GotoLatLng(Lat, Lang) {
   var latlng = new google.maps.LatLng(Lat,Lang);
   map.setCenter(latlng);
  }

  function GotoLatLngZoom(Lat, Lang, Zoom) {
   var latlng = new google.maps.LatLng(Lat,Lang);
   map.setCenter(latlng);
   map.setZoom(Zoom);
  }

  function ClearMarkers() {
    if (AllOtherUnits) {
      for (i in AllOtherUnits) {
        AllOtherUnits[i].setMap(null);
      }
    }
  }

  function PutOtherUnitOn(Lat, Lang, FullName) {
   var latlng = new google.maps.LatLng(Lat,Lang);
   var marker = new google.maps.Marker({
      position: latlng,
      map: map,
      title: FullName,
      icon: "http://www.commoditytradingforum.com/Police-32x32.ico"
    });
    AllOtherUnits.push(marker);
  }

  function PutOtherUnitOff(FullName) {
    if (AllOtherUnits) {
      for (i in AllOtherUnits) {
        if (AllOtherUnits[i].title == FullName) {
          AllOtherUnits[i].setMap(null);
        }
      }
    }
  }


  function PutMyUnitOn(Lat, Lang, FullName) {
   var latlng = new google.maps.LatLng(Lat,Lang);
   MyUnit = new google.maps.Marker({
      position: latlng,
      map: map,
      title: FullName,
      icon: "http://www.commoditytradingforum.com/Police-car-32.ico"
    });
  }

  function PutMyUnitOff() {
    if (MyUnit != null) {
      MyUnit.setMap(null)
    }
  }

</script>
</head>

<body onload="initialize(40.714776,-74.019213)">
  <div id="map_canvas" style="width:100%; height:100%"></div>
  <div id="latlong">
  <input type="hidden" id="LatValue" >
  <input type="hidden" id="LngValue" >
  </div>
</body>
</html>
4

1 回答 1

0

IE6 不是 Google Maps API v3 支持的浏览器:

https://developers.google.com/maps/faq#browsersupport

 Which web browsers does the Google Maps JS API support?
 The Google Maps JavaScript API supports the following web browsers:

 Google Maps JavaScript API V3:

 IE 8.0+ (Windows) *
 Firefox 3.0+ (Windows, Mac OS X, Linux)
 Safari 4+ (Mac OS X, iOS)
 Chrome (Windows, Mac OS X, Linux)
 Android
 BlackBerry 6
 Dolfin 2.0+ (Samsung Bada)
 * Internet Explorer's Compatibility View is not supported.
于 2013-05-16T13:07:47.917 回答