2010-12-08 12 views
0

私はブラックベリーのGoogleマップに複数の場所を表示することを含むアプリケーションを実装しています...Googleマップで複数の場所を表示することに関して

誰かが私にヒントを提供できますか?あなたはKMLファイル 例作成必要がある最初のGoogleマップ上の複数の場所を実装するための

答えて

1

: - サーバー上でこのファイルを保存(拡張子はKMLする必要があります)、以下のコードでそのパスを設定

<?xml version="1.0" encoding="UTF-8"?> 
<kml xmlns="http://www.opengis.net/kml/2.2"> 
<Document> 
    <Placemark> 
    <name>Ottawa</name> 
    <description>Ottawa office</description> 
    <Point> 
    <coordinates>-90.86948943473118,48.25450093195546,0</coordinates> 
    </Point> 
    </Placemark> 
    <Placemark> 
    <name>Battel Creek</name> 
    <description>Battel Creek</description> 
    <Point> 
    <coordinates>-85.1220703125,42.35042512243457,0</coordinates> 
    </Point> 
    </Placemark> 

    </Document> 
</kml> 

を: -

public void invokeGMaps() { 

     int mh = CodeModuleManager.getModuleHandle("GoogleMaps"); 
      if (mh == 0) { 
      try { 
      throw new ApplicationManagerException(
       "GoogleMaps isn't installed"); 
      } catch (ApplicationManagerException e) { 
      System.out.println(e.getMessage()); 
      } 
      } 
      String[] args = { };//PUT THE SAVED FILE URL OVER HERE IN DOUBLE QUOTES 
      ApplicationDescriptor ad = CodeModuleManager 
      .getApplicationDescriptors(mh)[0]; 
      ApplicationDescriptor ad2 = new ApplicationDescriptor(ad, args); 
      try { 
      ApplicationManager.getApplicationManager() 
      .runApplication(ad2, true); 
      } catch (ApplicationManagerException e) { 
      System.out.println(e.getMessage()); 
      } 
     } 

これらのコードを実装する前に、Googleマップをインストールする必要があります。 Googleマップはここからダウンロードできます: - m.google.com/maps

関連する問題