是的,我已经阅读了大量有关未在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>
答案 0 :(得分: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.