2013-08-21 63 views
1

在iphone中,我們可以使用 地圖:daddr = & saddr =; 通過蘋果原生地圖繪製兩點之間的路線,通過本地地圖輸入座標到黑莓Z10

Android中我們可以使用 地理:

在黑莓

,如果我使用貼圖:,我可以叫出本地地圖,當前位置爲中心。 但無法獲得兩點之間的方向,是否有任何特定的語法應該用於檢索方向?

回答

0

下面是在地圖中繪製路線的示例代碼。希望這會對您有所幫助。

欲瞭解更多詳情檢查RouteMapInvoker

import bb.cascades 1.0 
import bb.platform 1.0 

Page { 
    content: Container { 
    layout: DockLayout {} 

    attachedObjects:[ 
     RouteMapInvoker { 
      id: routeInvokerID 

      // This example shows binding properties to pre-defined values 
      // For example, you can request a route from Ottawa to Toronto, 
      // avoiding the highways. 

      // You can bind properties to values coming from other widgets 
      // within this QML page (for example, text field's input) 
      startLatitude : 45.416667   // Ottawa's latitude 
      startLongitude : -75.7    // Ottawa's longitude 
      startName  : "Ottawa, Ontario" 
      startDescription : "Canada's capital" 

      endLatitude  : 43.652527   // Toronto's latitude 
      endLongitude  : -79.381961   // Toronto's longitude 
      endName   : "Toronto, Ontario" 
      endDescription : "My trip's destination" 

      // Specify any extra route options... 
      avoidHighwaysEnabled : true 

      // Specify what should be the center of the map. 
      centerLatitude : 44.4555 
      centerLongitude : -77.7744 
      // 'heading' property is not explicitly set, 
      // so it will be: 0 (i.e., facing North). 

     } 
    ] 

    // Make a Cascades button (or any Cascades widget) 
    // that can be used to trigger route invoker. 
    Button {   
     verticalAlignment: VerticalAlignment.Center 
     horizontalAlignment: HorizontalAlignment.Center 

     text: "Get route" 

     // When button is clicked, call the invoker by its ID 
     onClicked: { 
      routeInvokerID.go(); 
     } 
    } 
    } 
} 
+0

感謝您的幫助,但是這是一個PhoneGap的應用程序,所以我嘗試看看是否有一個HTML/JS的辦法,或圍繞該工作的WebWorks的方法。 – invisible520

+0

@ invisible520對不起。我不知道電話... –