TShopping

 找回密碼
 註冊
搜索
查看: 1556|回復: 0

[教學] [Android智慧型手機設計_隱含意圖Google Map]

[複製鏈接]
發表於 2013-6-14 19:54:53 | 顯示全部樓層 |閱讀模式
 
Push to Facebook
Google map座標工具:

模擬器:target=Google Inc.:Google APIs:17


1.顯示地圖定位

使用Intent.ACTION_VIEW,關聯資料格式如下:

geo:latitude,longitude
geo:latitude,longitude?z=zoom
latitude為緯度值,longitude為經度值,?z=zoom為地圖縮放設定值(1~23),設定值1時為顯示地球縮圖
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:23.978996,120.696672?z=18"));
startActivity(intent);

2.地圖查詢
使用Intent.ACTION_VIEW,關聯資料格式如下:
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("geo:0,0?q=新竹市元培街306號"));
startActivity(intent);

3.顯示街景圖
使用Intent.ACTION_VIEW,關聯資料格式如下:
google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,zoom&mz=mapZoom
lat為緯度值,lng為經度值,yaw表示街景圖中心點視角(與正北方之逆時針角度值),pitch表示街景圖中心點仰角(-90表示朝正上方,90表示朝正下方),zoom為街景圖放大倍率值(1表示原尺寸),mapZoom表示當使用者由街景圖切換為地圖時,地圖的縮放設定值(1~23)
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse("google.streetview:cbll=23.978996,120.696672&cbp=1,0,,0,1.0"));
startActivity(intent);

4.路徑規劃
使用Intent.ACTION_VIEW,關聯資料格式如下:
http://maps.google.com/maps?f=d&saddr=startLat%2CstartLng&daddr=endLat%2CendLng&hl=tw"
startLat為路徑起點緯度值,startLng為路徑起點經度值;endLat為路徑終點緯度值,endLng為路徑終點經度值
Intent intent=newIntent(Intent.ACTION_VIEW,Uri.parse("http://maps.google.com/maps?f=d&saddr=23.979116%2C120.696788&daddr=24.05832%2C120.679065&hl=tw"));
startActivity(intent);


1.jpg


 

臉書網友討論

II.zip

1006.33 KB, 下載次數: 547

*滑块验证:
您需要登錄後才可以回帖 登錄 | 註冊 |

本版積分規則



Archiver|手機版|小黑屋|免責聲明|TShopping

GMT+8, 2024-3-28 21:39 , Processed in 0.060726 second(s), 26 queries .

本論壇言論純屬發表者個人意見,與 TShopping綜合論壇 立場無關 如有意見侵犯了您的權益 請寫信聯絡我們。

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回復 返回頂部 返回列表