Google maps Internet Explorer中的Google地图API
最近,我创建的谷歌地图API已经停止在INternet Explorer中工作(版本9,但也尝试了以前的版本),但仍然在Chrome中工作,我不明白为什么 如果有人能说明这一点,我将不胜感激 非常感谢 代码如下:Google maps Internet Explorer中的Google地图API,google-maps,internet-explorer,google-maps-api-3,Google Maps,Internet Explorer,Google Maps Api 3,最近,我创建的谷歌地图API已经停止在INternet Explorer中工作(版本9,但也尝试了以前的版本),但仍然在Chrome中工作,我不明白为什么 如果有人能说明这一点,我将不胜感激 非常感谢 代码如下: <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> <title>Google Maps Multiple Markers</ti
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<title>Google Maps Multiple Markers</title>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.10.1.min.js"></script>
</head>
<body>
<div id="map" style="width: 900px; height: 750px;"></div>
<script type="text/javascript">
var locations = [
['<h4><b>Kings Hill Office Area 4</></h4> <br>Balfour Beatty Mott MacDonald Area 4,10 Kings Hill Avenue, Kings Hill, Kent. ME19 4AR<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.275508,0.396321&z=17&daddr=Balfour+Beatty,+10+Kings+Hill+Ave,+Kings+Hill,+West+Malling,+Kent+ME19+4AR&output=classic&dg=ntvb"target="_blank"/>Click Here to get Directions to this location',51.275286, 0.395393],
['<h4><b>Spencer House Office Area 10</></h4> <br>Spencer House, 35 Dewhurst Road Birchwood. WA3<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.4118618,-2.5195415&z=15&daddr=53.4141389,-2.5269444&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.414139, -2.526935],
['<h4><b>Highways Agency Regional Office</></h4> <br>Floor 3B, Federated House, London Road, Dorking.RH4 1SZ<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.2381366,-0.3245188&z=17&daddr=Highways+Agency,+Federated+House/London+Rd,+Dorking+RH4+1SZ&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 51.239054, -0.324669],
['<h4><b>BB Workplace Basingstoke</></h4> <br>Central Office, Pavillion B, Ashwood Park, Ashwood Way, Basingstoke.Hants. RG23 8BG<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.274606,-1.113179&z=19&daddr=Balfour+Beatty+Ltd,+Pavilion,+C2+Ashwood+Park,+Basingstoke,+Hampshire+RG23+8BG&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 51.274646,-1.113198],
['<h4><b>Mott MacDonald, Stoneham</></h4> <br>Stoneham Place, Stoneham Lane, Southampton.Hants. SO50 9NW<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=50.95431,-1.372636&z=17&daddr=Mott+MacDonald,+Stoneham+Place,+Stoneham+Ln,+Southampton,+Hampshire+SO50+9NW&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 50.954319,-1.372759],
['<h4><b>Mott MacDonald Croydon</></h4> <br>Mott MacDonald House, 8-10 Sydenham Road, Croydon, Surrey. CR0 2EE<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.378,-0.096918&z=17&daddr=Mott+MacDonald,+8-10+Sydenham+Road,+Croydon+CR0+2EE&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 51.377943,-0.096613],
['<h4><b>Farthing Corner Depot</></h4><br>M2 Farthing Corner Depot, Gillingham, ME8 8PG<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.3411297,0.6074175&z=17&daddr=M2,+Rainham,+Gillingham,+Medway+ME8&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 51.340259, 0.605905],
['<h4><b>Coldharbour Depot</></h4> <br>M20 Coldharbour Depot, Coldharbour Lane, Little Preston, Aylesford. ME20 7NS<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.2975005,0.485606&z=15&daddr=51.297501,0.485606&output=classic&dg=ntvb"target="_blank"/>Click Here to get Directions to this location', 51.297501, 0.485606],
['<h4><b>Stanford Depot</></h4> <br>M20 Stanford Depot, Honeywood, Sandling, Hythe. Kent. CT21 4UX<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.0933623,1.0526985&z=17&daddr=51.0938,1.0518&output=classic&dg=ntvb"target="_blank"/>Click Here to get Directions to this location', 51.093800,1.051800],
['<h4><b>WeatherHill Depot</></h4> <br>M23 Weatherhill Depot, Hathersham Close, Smallfield.Surrey. RH6 9JE<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=51.1772075,-0.1255377&z=16&daddr=51.177699,-0.125999&output=classic&dg=ntvb"target="_blank"/>Click Here to get Directions to this location', 51.177699, -0.125999],
['<h4><b>Ford Depot</></h4> <br>A27 Ford Depot, Ford Lane, Ford, Near Arundel, BN18 0DF<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=50.8254764,-0.591252&z=15&daddr=50.825477,-0.591252&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location',50.825477, -0.591252],
['<h4><b>Lewes Depot</></h4> <br>Broyle Place Farm, Laughton Road, Ringmer. BN8 5SD<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=50.8963954,0.10098&z=15&daddr=50.896396,0.10098&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 50.896396,0.100980],
['<h4><b>Westhoughton Depot</></h4><br>Dehavilland Way, Westhoughton, Bolton. BL5 3NH<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.4118618,-2.5195415&z=15&daddr=53.4141389,-2.5269444&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.573025, -2.552319],
['<h4><b>Preston Brook Depot</><h4><br>A56 Chester Road, Preston Brook, Runcorn. WA7 3BA<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.4118618,-2.5195415&z=15&daddr=53.4141389,-2.5269444&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.313110, -2.674027],
['<h4><b>Hale Depot</></h4><br>Wilmslow Road Roundabout, Hale, Altrincham. WA15 8XL<br><br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.3505295,-2.2909&z=15&daddr=53.35053,-2.2909&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.350530, -2.290900],
['<h4><b>Brinnington Depot</></h4> <br>Ashton Road Roundabout, Bredbury, Stockport. SK6 2QN<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.3505295,-2.2909&z=15&daddr=53.35053,-2.2909&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.426265, -2.121903],
['<h4><b>Milnrow Depot</></h4><br>Elizabeth Way, Milnrow, Rochdale. OL16 4NH<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.6101112,-2.1163191&z=17&daddr=53.610498,-2.114581&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.610498, -2.114581],
['<h4><b>Knutsford Depot</></h4><br>Northwich Way, Tabley, Knutsford. WA16 0TL<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.3026095,-2.400456&z=15&daddr=53.30261,-2.400456&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.302610, -2.400456],
['<h4><b>Charnock Richard Depot</></h4><br>Mill Lane, Charnock Richard, Chorley.<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.6292425,-2.685604&z=15&daddr=53.629243,-2.685604&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.629243, -2.685604],
['<h4><b>Newton Le Willows Depot</></h4><br>Rob Lane, Newton Le Willows, Warrington. WA12 0DR<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.4596006,-2.6166221&z=17&daddr=53.460224,-2.616783&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.460224, -2.616783],
['<h4><b>Whitebirk Depot</></h4><br>Whitebank Bleachworks, Whitebank Road, Blackburn. BB1 3HY<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.7518802,-2.4479139&z=16&daddr=53.751481,-2.445178&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.751481, -2.445178],
['<h4><b>Tarbock Depot</></h4><br>Huyton, Prescott. Merseyside. L35 1QY<br>Depot Champion: <br>Depot Contact <br>More Text Here <br><a href="https://maps.google.co.uk/maps?ll=53.3982515,-2.818008&z=15&daddr=53.398252,-2.818008&output=classic&dg=ntvb" target="_blank"/>Click Here to get Directions to this location', 53.398252, -2.818008]
];
// Setup the different icons and shadows
var iconURLPrefix = 'http://<location of images>/';
var icons = [
iconURLPrefix + 'rangerstation.png',
iconURLPrefix + 'rangerstation.png',
iconURLPrefix + 'truck.png',
iconURLPrefix + 'ltblu-pushpin.png',
iconURLPrefix + 'ylw-pushpin.png',
iconURLPrefix + 'blue-pushpin.png',
iconURLPrefix + 'FarthingCorner_Icon.png',
iconURLPrefix + 'ColdHarbour_Icon.png',
iconURLPrefix + 'Stanford_Icon.png',
iconURLPrefix + 'WeatherHill_Icon.png',
iconURLPrefix + 'Ford_Icon.png',
iconURLPrefix + 'Lewes_Icon.png',
iconURLPrefix + 'WestHoughton_Icon.png',
iconURLPrefix + 'Preston_Brook_Icon.png',
iconURLPrefix + 'Hale_Icon.png',
iconURLPrefix + 'Brinnington_Icon.png',
iconURLPrefix + 'Milnrow_Icon.png',
iconURLPrefix + 'Knutsford_Icon.png',
iconURLPrefix + 'Charnock_Richard_Icon.png',
iconURLPrefix + 'Newton_Le_Willows_Icon.png',
iconURLPrefix + 'WhiteBirk_Icon.png',
iconURLPrefix + 'Tarbock_Depot.png',
]
var icons_length = icons.length;
var shadow = {
anchor: new google.maps.Point(15,33),
url: iconURLPrefix + 'msmarker.shadow.png'
};
var map = new google.maps.Map(document.getElementById('map'), {
zoom: 10,
center: new google.maps.LatLng(33.520661, -86.802490),
mapTypeId: google.maps.MapTypeId.ROADMAP,
mapTypeControl: false,
streetViewControl: false,
panControl: false,
scrollwheel: false,
zoomControlOptions: {
position: google.maps.ControlPosition.LEFT_BOTTOM
}
});
var infowindow = new google.maps.InfoWindow({
maxWidth: 160
});
var marker;
var markers = new Array();
var iconCounter = 0;
// Add the markers and infowindows to the map
for (var i = 0; i < locations.length; i++) {
marker = new google.maps.Marker({
position: new google.maps.LatLng(locations[i][1], locations[i][2]),
map: map,
icon : icons[iconCounter],
shadow: shadow
});
markers.push(marker);
google.maps.event.addListener(marker, 'click', (function(marker, i) {
return function() {
infowindow.setContent(locations[i][0]);
infowindow.open(map, marker);
}
})(marker, i));
iconCounter++;
// We only have a limited number of possible icon colors, so we may have to restart the counter
if(iconCounter >= icons_length){
iconCounter = 0;
}
}
function AutoCenter() {
// Create a new viewpoint bound
var bounds = new google.maps.LatLngBounds();
// Go through each...
$.each(markers, function (index, marker) {
bounds.extend(marker.position);
});
// Fit these bounds to the map
map.fitBounds(bounds);
}
AutoCenter();
</script>
谷歌地图多个标记
变量位置=[
['Kings Hill办公区4
Balfour Beatty Mott MacDonald办公区4,肯特郡Kings Hill大道10号,ME19 4AR
仓库冠军:
仓库联系人
此处有更多文本
单击此处获取此位置的方向,'51.275286,0.395393],
['Spencer House办公区10
Birchwood Dewhurst路35号Spencer House.WA3
停车场冠军:
停车场联系人
此处的更多文本
单击此处获取此位置的方向,'53.41414139,-2.526935],
['Droking.RH4 1SZ伦敦路联邦大厦3B楼公路局区域办事处
车辆段冠军:
车辆段联系人
此处的更多文本
单击此处获取该位置的方向,'51.239054,-0.324669],
['BB Workplace Basingstoke
Basingstoke Ashwood Way Ashwood Park B馆中央办公室Basingstoke.Hants.RG23 8BG
停车场冠军:
停车场联系人
此处的更多文本
单击此处获取此位置的方向,'51.274646,-1.113198],
['Mott MacDonald,Stoneham
Stoneham Place,Stoneham Lane,Southampton.Hants.SO50 9NW
仓库冠军:
仓库联系人
此处的更多文本
单击此处获取此位置的方向,'50.954319,-1.372759],
['Mott MacDonald Croydon
萨里郡Croydon Sydenham路8-10号Mott MacDonald House.CR0 2EE
停车场冠军:
停车场联系人
此处的更多文本
单击此处获取此位置的方向,'51.377943,-0.096613],
['Farthing Corner Depot
M2 Farthing Corner Depot,Gillingham,ME8 8PG
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'51.340259,0.605905],
['Coldharbour Depot
M20 Coldharbour Depot,Coldharbour Lane,Little Preston,Aylesford.ME20 7NS
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'51.297501,0.485606],
['Stanford Depot
M20 Stanford Depot,Honeywood,Sandling,Hyte.Kent.CT21 4UX
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'51.093800,1.051800],
['WeatherHill Depot
M23 WeatherHill Depot,Hathersham Close,Smallfield.Surrey.RH6 9JE
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'51.177699,-0.125999],
['Ford Depot
A27 Ford Depot,Ford Lane,Ford,Arundel附近,BN18 0DF
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'50.825477,-0.591252],
['Lewes Depot
Broyle Place Farm,Ringmer.劳顿路,BN8 5SD
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'50.896396,0.100980],
['Westhoughton Depot
Dehavilland Way,Westhoughton,Bolton.BL5 3NH
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.573025,-2.552319],
['Preston Brook Depot
A56 Chester Road,Preston Brook,Runcorn.WA7 3BA
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.3110,-2.674027],
['Hale Depot
阿尔特林查姆Hale Wilmslow路环岛WA15 8XL
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.350530,-2.290900],
['Brinnington Depot
Stockport布雷德伯里阿什顿路环岛。SK6 2QN
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.426265,-2.121903],
['Milnrow Depot
Elizabeth Way,Milnrow,Rochdale.OL16 4NH
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,53.610498,-2.114581],
['Knutsford Depot
Northwich Way,Tabley,Knutsford.WA16 0TL
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,53.302610,-2.400456],
['Charnock Richard Depot
Mill Lane,Charnock Richard,Chorley。
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.629243,-2.685604],
['Newton Le Willows仓库
Rob Lane,Newton Le Willows,Warrington.WA12 0DR
仓库冠军:
仓库联系人
此处的更多文本
单击此处获取此位置的方向,53.460224,-2.616783],
['Whitebirk Depot
布莱克本Whitebank路Whitebank BleetWorks.BB1 3HY
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,53.751481,-2.445178],
['Tarbock Depot
普雷斯科特休顿,默西塞德郡,L35 1QY
Depot Champion:
Depot Contact
此处的更多文本
单击此处获取此位置的方向,'53.398252,-2.818008]
];
//设置不同的图标和阴影
var iconURLPrefix='http://';
变量图标=[
iconURLPrefix+“rangerstation.png”,
iconURLPrefix+“rangerstation.png”,
iconURLPrefix+“truck.png”,
iconURLPrefix+“ltblu pushpin.png”,
iconURLPrefix+“ylw pushpin.png”,
iconURLPrefix+“蓝色图钉.png”,
iconURLPrefix+“FarthingCorner_Icon.png”,
iconURLPrefix+‘ColdHarbour_Icon.png’,
iconURLPrefix+“Stanford_Icon.png”,
iconURLPrefix+“WeatherHill_Icon.png”,
iconURLPrefix+“Ford_Icon.png”,
iconURLPrefix+“Lewes_Icon.png”,
iconURLPrefix+“WestHoughton_Icon.png”,
iconURLPrefix+“Preston_Brook_Icon.png”,
iconURLPrefix+'H
iconURLPrefix + 'WhiteBirk_Icon.png',
iconURLPrefix + 'Tarbock_Depot.png',
]