有去申請api key




<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<title>Google Maps JavaScript API Example</title>
type="text/javascript">
var IMAGES = [ "car_000.PNG", "car_045.PNG", "car_090.PNG", "car_135.PNG", "car_180.PNG", "car_225.PNG", "car_270.PNG", "car_315.PNG" ];
var m_x = 0;
var m_y = 0;
var marker=null;
var icons = [];
var centericon = null;
function GM_load()
{
try
{
if (GBrowserIsCompatible()) {
map = new GMap2(document.getElementById("map_canvas"));
map.addControl(new GSmallZoomControl());//GLargeMapControl3D());//GSmallZoomControl());//GSmallMapControl());
map.setCenter(new GLatLng(23.69781,120.960515), 14);
map.enableScrollWheelZoom();
map.addMapType(G_PHYSICAL_MAP);
var mapControl = new GHierarchicalMapTypeControl();
mapControl.clearRelationships();
mapControl.addRelationship(G_SATELLITE_MAP, G_HYBRID_MAP, "Labels", true);
map.addControl(mapControl);
centericon = new GIcon();
centericon.image = "car_location2.png";
centericon.iconSize = new GSize(30, 30);
centericon.iconAnchor = new GPoint(15, 15);
}
}
catch(e)
{
}
}
function initicon2(path)
{
try
{
for (var i = 0; i < 8; ++i)<br>{
if(!icons[i])
{
icons[i] = new GIcon();
icons[i].image = path + IMAGES[i];
icons[i].iconSize = new GSize(32, 32);
icons[i].iconAnchor = new GPoint(16, 16);
}
}
}
catch(e)
{
}
}
function setpin(x, y)
{
try
{
if(marker != null)
{
marker.setPoint(new GLatLng(x, y));
}
else
{
marker = new GMarker(new GLatLng(x, y), {icon: centericon});
map.addOverlay(marker);
}
map.setCenter(new GLatLng(x, y), map.getZoom());
}
catch(e)
{
}
}
function clearOvr()
{
try
{
map.clearOverlays();
marker = null;
}
catch(e)
{
}
}
function move1(x, y)
{
try
{
if(m_x != 0)
{
var polyline = new GPolyline(
[
new GLatLng(m_x, m_y),
new GLatLng(x, y)
],
"#ff0000", 3);
map.addOverlay(polyline);
}
m_x = x;
m_y = y;
}
catch(e)
{
}
}
function move2()
{
try
{
map.panTo(new GLatLng(37.4788598506851, 126.8799501657486));
var polyline = new GPolyline([
new GLatLng(37.478434141114064, 126.87977313995361),
new GLatLng(37.479149331808166, 126.87921524047851)
], "#ff0000", 3);
map.addOverlay(polyline);
}
catch(e)
{
}
}
function move3()
{
try
{
map.panTo(new GLatLng(37.4788598506851, 126.8799501657486));
var polyline = new GPolyline([
new GLatLng(37.479149331808166, 126.87921524047851),
new GLatLng(37.47972829068993, 126.88179016113281)
], "#ff0000", 3);
map.addOverlay(polyline);
}
catch(e)
{
}
}
</head>
<body onload="GM_load()" scroll=no leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
</body>
</html>




























































































