List of all Iphone and Blackberry Development codes in a one click Iphone,objective C,xcode,blackberry Development,iOS Development

Wednesday, July 24, 2013

Showing Google Maps in Blackberry

The following code will show your location in google map. No inbuilt Maps neede for this. Just fetch the location and pass it here.

  StringBuffer html;
  String initial = "\r\n" +
        " \r\n" +
        " \r\n" +
        "   \r\n" +
        "  Google Maps Multiple Markers \r\n" +
        "  \r\n" +
        "
\r\n" +        "\r\n" +
        "  


\r\n" +
        "\r\n" +
        "  \r\n" +
        "
\r\n" +        "
";
  html=new StringBuffer();
  html.append(initial);
 
  //add your location here
  String point = "['"+""+"',"+lattitude+","+longitude+","+""+"],";
        html.append(point);
        //add your location here
       centerPoint = "  center: new google.maps.LatLng("+lattitude+","+longitude+"),";
       html.append(second);
       html.append(centerPoint);
       html.append(finalpart);
       //System.out.println("Plot is"+html.toString());
       BrowserFieldConfig _bfConfig = new BrowserFieldConfig();      
      _bfConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER);
      _bfConfig.setProperty( BrowserFieldConfig.JAVASCRIPT_ENABLED, Boolean.TRUE );
      _bfConfig.setProperty(BrowserFieldConfig.USER_AGENT, "MyApplication 1.0");
      BrowserField myBrowserField = new BrowserField(_bfConfig);

       myBrowserField.displayContent(html.toString(), "");
       HorizontalFieldManager horf=new HorizontalFieldManager(HORIZONTAL_SCROLL);
       horf.add(myBrowserField);
  add(horf);
 

No comments:

Post a Comment