Google maps 移动标记时如何绘制多段线
我使用的是ThinkingStiff的代码 当标记移动时,如何添加到代码中以绘制多段线Google maps 移动标记时如何绘制多段线,google-maps,Google Maps,我使用的是ThinkingStiff的代码 当标记移动时,如何添加到代码中以绘制多段线 <script type='text/javascript'>//<![CDATA[ $(window).load(function(){ function initialize() { var myLatLng = new google.maps.LatLng( 50, 50 ), myOptions = { zoom: 4,
<script type='text/javascript'>//<![CDATA[
$(window).load(function(){
function initialize() {
var myLatLng = new google.maps.LatLng( 50, 50 ),
myOptions = {
zoom: 4,
center: myLatLng,
mapTypeId: google.maps.MapTypeId.ROADMAP
},
map = new google.maps.Map( document.getElementById( 'map-canvas' ), myOptions ),
marker = new google.maps.Marker( {position: myLatLng, map: map} );
marker.setMap( map );
moveMarker( map, marker );
}
function moveMarker( map, marker ) {
//delayed so you can see it move
setTimeout( function(){
marker.setPosition( new google.maps.LatLng( 54, 54 ) );
map.panTo( new google.maps.LatLng( 54, 54 ) );
}, 1500 );
};
initialize();
});//]]>
</script>
//