<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>兩個地點之間的路線規劃-陣列變數寫法</title>
<link rel="stylesheet" href="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.css">
<script src="jquery.mobile-1.4.2/jquery-1.9.1.min.js"></script>
<script src="jquery.mobile-1.4.2/jquery.mobile-1.4.2.min.js"></script>

 

<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>

<script language="Javascript">
        function Route(){ 
   // 取得起始點的 GPS 位置
        var lat1 = 25.046066;
        var lng1 = 121.517213;  
   // getLocation(); // 取得終點的 GPS 位置
        var lat2 = 25.034707;
        var lng2 = 121.521805;      

       window.open("http://maps.google.com/maps?f=d&saddr=" + lat1 + "," + lng1 + "&daddr=" + lat2 +","+ lng2+ "&hl=zh-TW&ie=UTF8");
}
       
</script>

</head>

<body>
<div data-role="page" id="pageHome">
<div data-role="content">

<p>
<div data-role="fieldcontain">
<p>
<label for="selectmenu" class="select">起始點:</label>
<select name="selectmenu" id="selectmenu">
<option value="0" selected="selected">台南大學</option>
<option value="1">成功大學</option>
<option value="2">首府大學</option>
<option value="3">南榮科大</option>
</select>
&nbsp;    </p>
<div data-role="fieldcontain">
<label for="selectmenu2" class="select">終點:</label>
<select name="selectmenu2" id="selectmenu2">
<option value="0" selected="selected">台南大學</option>
<option value="1">成功大學</option>
<option value="2">首府大學</option>
<option value="3">南榮科大</option>
</select>
</div>
</p>
<p>&nbsp;
<button data-icon="search" onclick="Route()" >路線規劃</button>
</p>
</div>
</p>

  </div>

</div>

</div>

</body>
</html>