關於路徑規劃

71 views
Skip to first unread message

Ah傑

unread,
Nov 15, 2008, 7:10:21 AM11/15/08
to Google API 技術論壇
前陣子Google Map地圖推出了路徑規劃

請問有API釋出了嗎??

有的話又該如何使用呢??

Andy

unread,
Nov 15, 2008, 10:28:28 PM11/15/08
to Google API 技術論壇

Ah傑

unread,
Nov 15, 2008, 11:30:54 PM11/15/08
to Google API 技術論壇
OK 感謝

On 11月16日, 上午11時28分, Andy <fishbu...@gmail.com> wrote:
> 請參考http://code.google.com/apis/maps/documentation/reference.html#GDirect...

Ah傑

unread,
Nov 17, 2008, 2:07:29 AM11/17/08
to Google API 技術論壇
ㄜ...不太懂運用的方法
有看範例 大多是用load()裡面放字串"from ... to: ..." (...是地址)
不過我想要用點跟點的路徑規畫有辦法嗎@@?
也就是目前的收到的資料是( 25.04728911127607, 121.51617050170898)跟
(25.043148371607103, 121.50698661804199)
兩組點當起終點
有method可以運用嗎??

看了docs裡面的GDirections.loadFromWaypoints(waypoints, queryOpts?)
應該就是能做到我所想做的事,不過我不知道放入的格式...
所以怎麼試也沒個結果(字串、form..to..試過了)
感謝回答

Ah傑

unread,
Nov 17, 2008, 3:17:29 AM11/17/08
to Google API 技術論壇
噗 我成功啦

這篇當作沒問@@"

Andy Cheng

unread,
Nov 17, 2008, 3:34:09 AM11/17/08
to Google API 技術論壇
可以和大家分享一下是如何做的嗎?
謝謝

Ah傑

unread,
Nov 17, 2008, 4:07:18 AM11/17/08
to Google API 技術論壇
http://163.25.102.229/147

自己看看原始碼吧

沒像GOOGLE的服務那麼好

只是單純的兩點路徑規畫

Andy Cheng

unread,
Nov 17, 2008, 4:14:41 AM11/17/08
to Google API 技術論壇
...
directions.load("from: 25.001169323785923, 121.45265579223633 to:
25.03341222278933, 121.56749725341797");
...

changfm

unread,
Nov 25, 2008, 11:56:21 PM11/25/08
to Google API 技術論壇
GDirections.loadFromWaypoints( [new GLatLng(lat1,lng1), new GLatLng
(lat2,lng2) .... ] );
應該也可以傳 GLatLng 的 Array進去。
Reply all
Reply to author
Forward
0 new messages