我創建從我的網頁上的地圖,顯示在某個位置AIS-船舶:海上交通地圖 - 緯度/經度的Javascript
<!DOCTYPE html>
<html>
<body>
<script type="text/javascript">
width='40%'; //the width of the embedded map in pixels or percentage
height=430; //the height of the embedded map in pixels or percentage
border=1; //the width of border around the map. Zero means no border
notation=false; //true or false to display or not the vessel icons and
//options at the left
shownames=false; //true or false to dispaly ship names on the map
latitude=59.01; //the latitude of the center of the map in decimal degrees
longitude=5.78; //the longitude of the center of the map in decimal degrees
zoom=10; //the zoom level of the map. Use values between 2 and 17
maptype=3;
trackvessel=0; //the MMSI of the vessel to track, if within the range
fleet=''; //the registered email address of a user-defined fleet
remember=false;
scale=2;
</script>
<script type="text/javascript" src="http://www.marinetraffic.com/ais/embed.js">
</script>
</body>
</html>
而是在經度衝壓及手工緯度的代碼,我想將從例如iPhone檢索到的GPS位置放在這些字段中。我嘗試了幾種解決方案,但我似乎沒有把它做對。有沒有人有一個很好的解決這個問題?
請始終聲明一個變量與'var a ='foo'' –
你有什麼試過?你如何獲得GPS座標?您需要以某種方式將這些座標注入到瀏覽器中的文件中,例如,您可以使用PHP嗎? – jrouquie