2010-06-21 73 views
0

我正在使用以下代碼在我的模擬器中調用Google地圖。我已經在我的模擬器中安裝了Google地圖。調用Google地圖

int mh = CodeModuleManager.getModuleHandle("GoogleMaps"); 
     if(mh > 0) { 
    try{ 
URLEncodedPostData uepd = new URLEncodedPostData(null, false); 
uepd.append("action","LOCN"); 
uepd.append("a", "@latlon:"+lat+","+log); 
uepd.append("title","Stanford University School of Medicin"); 
uepd.append("description", "XYZ"); 
String[] args = { "http://gmm/x?"+uepd.toString() }; 
ApplicationDescriptor ad = CodeModuleManager.getApplicationDescriptors(mh)[0]; 
ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args); 
ApplicationManager.getApplicationManager().runApplication(ad2, true); 
}catch(Exception e){ 
System.out.println(e+"Excepton"); 
}}} 

但我得到一個白色的屏幕,當我按菜單按鈕運行GMAPS選項是他們的。但是當我按下RUN GMAPS時,結果也是一樣的,只有白色屏幕即將到來。我不明白爲什麼它會到來。有人請幫我出來

我也想知道。如何在谷歌地圖中插入多個地方。

在此先感謝

+1

我會推薦你​​使用黑莓地圖,它比谷歌地圖使用的帶寬要少很多。 – 2010-06-22 01:46:42

+0

你的代碼對我來說工作正常。 – Vivart 2010-06-22 11:47:33

+0

@Vivart是對的,上面的代碼也** [爲我工作](http://stackoverflow.com/questions/9977201/bing-maps-sdk-for-blackberry-6-0/9987588#9987588)** 。您還可以考慮將[BlackBerry Maps](http://docs.blackberry.com/en/developers/deliverables/1181/GPS%20and%20BlackBerry%20Maps%20Development%20Guide.pdf)作爲[Michael B。](http ://stackoverflow.com/users/83253/michael-b)建議。 – 2012-12-31 11:34:16

回答

0

我想你應該使用kml文件。

BrowserSession visit = Browser.getDefaultSession(); 
visit.displayPage("http://www.geochemie.uni-bremen.de/kml/borabora.kml"); 

你也可以在模擬器上測試。