0

i create a html file that show a google map using javascript i tried it on chrome and firefox and its working, now i want to show the map into my blackberry app so i put it into eclipse and create a browserfield that show the content of this html file, but when i open the app it show blank, the map does not appear

this is the code of map in javascript:

    <style type="text/css">
    html, body, #map-canvas { height: 100%; margin: 0; padding: 0;}
    </style>
    <script type="text/javascript" src="https://maps.googleapis.com/maps/api/js?    AIzaSyBxGIma4VDwwcvBjgqLkfDLTxHFVV1mGd8">
     </script>
     <script type="text/javascript">

and this is the code how i show the browser field in blackberry

        BrowserField browserField = new BrowserField(myBrowserFieldConfig);

             InputStream content =    getClass().getResourceAsStream("/map.html");     
             try {
                   byte[] html = IOUtilities.streamToBytes(content);
                   String htmltxt = new String(html);

                 browserField.displayContent(new String(htmltxt),  "local:///");


             } catch (IOException e) {
                e.printStackTrace();
             }
Malo
  • 1,232
  • 2
  • 17
  • 28

1 Answers1

0

In the previous question you asked about this, I linked this answer to you. Max said it's not possible because of poor Javascript support in BrowserFields.

This post suggests that it's because the browerfield does not support AJAX (which I am inclined to believe). The final post on that link does claim to have it working, albeit with an inconsistent map marker. It's worth a try, but other than that you'll need to either use static maps, or launch the google maps app.

Community
  • 1
  • 1
Kevin
  • 1,626
  • 16
  • 30
  • sorry but this is not true, i have already display a map into browser field but the map was located on server with javascript and jquery and i show the map using browser field like this BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig(); myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE,BrowserFieldConfig.NAVIGATION_MODE_POINTER); BrowserField browserField = new BrowserField(myBrowserFieldConfig); // add(browserField); browserField.requestContent("link of the map"); – Malo May 15 '15 at 07:47