IE8上的标记无法正常工作

时间:2014-07-05 20:05:58

标签: google-maps internet-explorer-8 google-maps-markers

我无法在IE8中显示标记,这是我的代码,请帮助!!

<script src="http://maps.google.com/maps/api/js?sensor=false&.js" type="text/javascript"></script>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"/></script>

------------风格----------------------------------

    <style>
#map_canvas {
 width: 100%;
    height: 500px;
}

------------ Javascript Code -------------------------------

var map;

jQuery(document).ready(function() {

var elevator;
var myOptions = {
    zoom: 11,
    center: new google.maps.LatLng(-31.400, -64.183)
};

map = new google.maps.Map($('#map_canvas')[0], myOptions);








var addresses = [
'Ambrosio Olmos 1500 Cordoba', 
'Montevideo 500 Cordoba'];

for (var x = 0; x < addresses.length; x++) {
   $.getJSON('http://maps.googleapis.com/maps/api/geocode/json?address='+addresses[x]+'&sensor=false', function (data) {

        var p = data.results[0].geometry.location
        var latlng = new google.maps.LatLng(p.lat, p.lng);

        new google.maps.Marker({
            position: latlng,
            map: map,animation: google.maps.Animation.DROP,

        });
    });
 }

});

HTML

<div id="map_canvas"></div>

0 个答案:

没有答案