/ API / JS?传感器=假” 类型= “文本/ JavaScript的” >< /脚本>
< style type =“text / css”>
。 MAPINFO </跨度> { 字体大小:12像素; 文本转换:大写;}
&LT; /风格&GT;
&lt; script type =“text / javascript …”)), parseFloat(标记[I] .getAttribute( “LNG”))); // var html =“&lt; span class =’ MAPINFO </跨度> “&GT;&LT; B&gt;地址:其中/ B个“+地址+”,“+城镇+”&lt; br /&gt;&lt; b&gt;价格:&lt; / b&gt; “+ value +”&lt; / span …
试试这个...(更改第34行中的标记图标路径)
<html> <head> <style type="text/css"> html { height: 100% } body { height: 100%; margin: 0; padding: 0 } #map_canvas { height: 100% } </style> <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?key=AIzaSyBdTuWJjEUMvQZ6VVPGksE12XNgQgs__Qk&sensor=false&libraries=visualization"></script> <script language="javascript"> var myLatlng = new google.maps.LatLng(41.7833, 5.2167); var markersArray = [ new google.maps.LatLng(20.11, 73.06), new google.maps.LatLng(10.11, 77.18), new google.maps.LatLng(33.11, 75.18), new google.maps.LatLng(25.11, 77.18), new google.maps.LatLng(31.37, 74.55), new google.maps.LatLng(22.56, 88.36), new google.maps.LatLng(12.98, 77.58) ]; var markers = []; var iterator = 0; var map; var image = '/home/aravi/heatmap/gdot.png' ; function drop() { for ( i = 0; i < markersArray.length; i++) { setTimeout(function() { addMarker(); }, i*300); } } function addMarker() { markers.push(new google.maps.Marker({ position: markersArray[iterator], map: map, draggable: false, opacity: 0.5, // animation: google.maps.Animation.DROP, icon: image })); iterator++; } function view() { var styles = [ { stylers: [ { hue: "#e0e0e0" }, { saturation: -100 }, {invert_lightness: false} ] },{ featureType: "all", elementType: "geometry.fill", stylers: [ { visibility: "on" } ] } ]; var mapOptions = { zoom:2, center: myLatlng, mapTypeId: google.maps.MapTypeId.ROADMAP, opacity: 0.2, draggable: false, disableDefaultUI: true, styles: styles }; map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions); drop (); } </script> </head> <body onLoad="view()"> <div id="map_canvas" style="width:53%; height:70%; margin-left: 500px; margin-top: 38px;"> </div> </body> </html>
把它放在一个单独的 function 例如 addMarker()
function
addMarker()
function addMarker() { var marker = new google.maps.Marker({ map: map, position: point, icon: '1364428325_golf.png', animation: google.maps.Animation.DROP, shadow: icon.shadow }); }
然后打电话 addMarker() 在你的 setTimeout() 功能
setTimeout()
在你的代码中,我无法看到你在setTimeOut()中描述的方法标记()
你可以随时访问 https://gist.github.com/donpaul120/dc97f4ec4785521b3a66 并实现它。
我希望这有帮助...