<script src="http://www.mapquestapi.com/sdk/js/v7.0.s/mqa.toolkit.js?key=Fmjtd%7Cluuanuuy2q%2C7x%3Do5-96bl50"></script>
<script type="text/javascript">

var lat1 = 0.;
var lon1 = 0.;
var Datetime;
var Speed = 0;
var ClearFlag = 0;
var MapNeedMove = 1;
var TrackNeedDraw = 0;
var start = false;
var polyline = false;
var line = new Array();
var Alias;

var old_lat = 0.;
var old_lon = 0.;

window.onload = function () {
	setInterval(movePlacemark, 500);
}

function movePlacemark()
{
	if(lat1)
	{
		if(!start)
		{
			var options={elt:'map_canvas',zoom:15, latLng:{lat:parseFloat(lat1), lng:parseFloat(lon1)},mtype:'map',bestFitMargin:0,zoomOnDoubleClick:true};
			map = new MQA.TileMap(options);
			MQA.withModule('smallzoom', function() {map.addControl(new MQA.SmallZoom(),new MQA.MapCornerPlacement(MQA.MapCorner.TOP_LEFT, new MQA.Size(5,5)));});
			MQA.withModule('viewoptions', function() {map.addControl(new MQA.ViewOptions());});

			pt=new MQA.Poi({lat:parseFloat(lat1), lng:parseFloat(lon1)});
			pt.setRolloverContent(Speed + 'êì/÷');
			pt.setInfoContentHTML('<B>' + Alias + '</B>' + '<BR>' + Datetime + '<BR>' + Speed + 'êì/÷');				
			map.addShape(pt);
			start = true;
		}
		if(lat1 != old_lat || lon1 != old_lon)
		{
			map.removeShape(pt);
			pt=new MQA.Poi({lat:parseFloat(lat1), lng:parseFloat(lon1)});
			pt.setRolloverContent(Speed + 'êì/÷');
			pt.setInfoContentHTML('<B>' + Alias + '</B>' + '<BR>' + Datetime + '<BR>' + Speed + 'êì/÷');				
			map.addShape(pt);
			if(TrackNeedDraw == 1)
			{
				if(!polyline)
				{
				        line[0] = lat1;
				        line[1] = lon1;
					MQA.withModule('shapes', function() {polyline = new MQA.LineOverlay(); polyline.setShapePoints(line); map.addShape(polyline); map.bestFit();});
				}
			        line[line.length] = lat1;
			        line[line.length] = lon1;
				map.removeShape(polyline);
				MQA.withModule('shapes', function() {polyline = new MQA.LineOverlay(); polyline.setShapePoints(line); map.addShape(polyline); map.bestFit();});
			}
//			if(MapNeedMove == 1)
//			{       	
//     				map.setCenter(latlng);
//			}
			old_lat = lat1;
			old_lon = lon1;
		}
	}
}
</script>

<BODY>
    <div id="map_canvas" style="width:700;height:500"></div>
</BODY>