<script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.3/jsl.js?with=all"></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)
		{
			nokia.Settings.set( "appId", "-xWLyZYxC5OKYYhb-je-"); 
			nokia.Settings.set( "authenticationToken", "D4DN8VmPzmGF58FZRF21VA");
			map = new nokia.maps.map.Display(map_canvas, {center: [parseFloat(lat1), parseFloat(lon1)],zoomLevel: 14, components:[new nokia.maps.map.component.ZoomBar(), new nokia.maps.map.component.DistanceMeasurement(), new nokia.maps.map.component.Behavior()]});
			pt = new nokia.maps.map.StandardMarker([parseFloat(lat1), parseFloat(lon1)]);
			map.objects.add(pt);
			pt.set("text", Speed + 'êì/÷');	
			pt.set("textPen", { strokeColor: "#0000"});	
			start = true;
		}
		if(lat1 != old_lat || lon1 != old_lon)
		{
			pt.set("coordinate", [parseFloat(lat1), parseFloat(lon1)]);
//			pt.set("text", Speed + 'êì/÷');
			pt.set("text", Speed);
			if(TrackNeedDraw == 1)
			{
				if(!polyline)
				{
				        line[0] = [parseFloat(lat1), parseFloat(lon1)];
				        line[1] = [parseFloat(lat1), parseFloat(lon1)];
					polyline = new nokia.maps.map.Polyline(line);
					map.objects.add(polyline);
				}
				else
				{
					polyline.destroy();
				        line[line.length] = [parseFloat(lat1), parseFloat(lon1)];
					polyline = new nokia.maps.map.Polyline(line, { pen: { strokeColor: "#FF0000", lineWidth: 4 }});
					map.objects.add(polyline);
				}
			}
			if(MapNeedMove == 1)
			{       	
       				map.setCenter([parseFloat(lat1), parseFloat(lon1)]);
			}
			old_lat = lat1;
			old_lon = lon1;
		}
	}
}
</script>

<BODY>
	<div id="map_canvas" style="width:100%;height:100%"></div>
</BODY>