「谷歌地圖應用程式介面」修訂間的差異
跳至導覽
跳至搜尋
(→導入) |
(→導入) |
||
| 第2行: | 第2行: | ||
===導入=== | ===導入=== | ||
<pre><script type='text/javascript' src='http://google.com/maps/api/js?sensor=false'></script></pre> | <pre><script type='text/javascript' src='http://google.com/maps/api/js?sensor=false'></script></pre> | ||
| + | |||
| + | ===基本地圖建構=== | ||
| + | <pre>var 變數名=new google.maps.LatLng(37,104);</pre> | ||
| + | 傳回字串:(37,104),前者為緯度,後者為經度。 | ||
| + | <pre>物件名(通常叫map)=new google.maps.Map(document.getElementById('div名'),JSON值);</pre> | ||
| + | 傳回地圖物件,其基本性質由JSON值描述: | ||
| + | :zoom:縮放級數, | ||
| + | :center:(緯度,經度), | ||
| + | :mapTypeId:google.maps.MapTypeId.TERRAIN | ||
| + | <pre></pre> | ||
| + | <pre></pre> | ||
| + | <pre></pre> | ||
| + | <pre></pre> | ||
於 2018年5月12日 (六) 08:52 的修訂
導入
<script type='text/javascript' src='http://google.com/maps/api/js?sensor=false'></script>
基本地圖建構
var 變數名=new google.maps.LatLng(37,104);
傳回字串:(37,104),前者為緯度,後者為經度。
物件名(通常叫map)=new google.maps.Map(document.getElementById('div名'),JSON值);
傳回地圖物件,其基本性質由JSON值描述:
- zoom:縮放級數,
- center:(緯度,經度),
- mapTypeId:google.maps.MapTypeId.TERRAIN