locked
Google Maps API Works in Browser but not BrowserControl RRS feed

  • Question

  • I've come across a intersting issue, we are using a Google Maps API Implimentation on a website for a cross-platform site to support mini-apps. When I visit the site using the Windows 7 Mobile Browser directly, the Map and pins load no problem. However, if I try to embed that same page inside a BrowserControl (In an App) The Map and pins load, but the map itself disapears almost instantly. The pins continue to work but the map itself is never visable.

    I Thought it might be something with our implimentation so I tried to embed one of Google's "Sample Pages", which was just a very simple implimentation. This had the exact same behavior, working in the full-fledged Win7 Mobile Browser, but the map disapearing on the Browser Control.

    Scripting is enabled, but I couldn't find anything myself or through searching to uncover why the maps are disapearing on the BrowserControl. Any suggestions or ideas would be apperciated!

    Google Map API : http://code.google.com/apis/maps/documentation/javascript/
    Friday, February 10, 2012 2:36 PM

Answers

  • I replaced my webbrowser declaration with the XAML you posted but I didn't see the problem you describe. 

    I then tried creating a new project targeting Windows Phone OS 7.0 and I was able to reproduce the problem.
    Is your application project targeting Windows Phone OS 7.0 or 7.1 ?

    If your project targets 7.0 then the WebBrowser control also runs in a backward compatability mode.
    If you require HTML 5 then you should target Windows Phone OS 7.1.
    Monday, February 13, 2012 5:16 PM

All replies

  • ...so I tried to embed one of Google's "Sample Pages", which was just a very simple implimentation. This had the exact same behavior, working in the full-fledged Win7 Mobile Browser, but the map disapearing on the Browser Control.


    What do you mean by "embed" in this context?

    Are you "embed"ding the content into your own pages?  If so do your own pages specify html5, using: <!DOCTYPE html>?

    Or are you saving the html page to IsolatedStorage and loading from there? 

    FWIW:
     I tried referencing their "map-simple.html" sample page and it loaded just fine in the WebBrowser control in my own app. 
    Friday, February 10, 2012 10:11 PM
  • Hi Eric,

    Thanks for the reply. I Put the sample code onto our web host, and had the webbrowser load that URL.

    What settings are you using for your web browser control?

    This is what i'm using, if you search using the pop-up it switches over to a google map, that disapears on me. Happening on both the emulator and a Samsung phone we have for testing.

                        <phone:WebBrowser Source="http://findnyccondoms.com/?p=find&amp;b=win7mo" x:Name="find_web" Navigated="find_web_Navigated" IsScriptEnabled="True" CacheMode="BitmapCache" HorizontalContentAlignment="Left" ScriptNotify="find_web_ScriptNotify_1" /> 
     

    The Page is declared as html 5 using <!DOCTYPE html>
    Monday, February 13, 2012 3:24 PM
  • I replaced my webbrowser declaration with the XAML you posted but I didn't see the problem you describe. 

    I then tried creating a new project targeting Windows Phone OS 7.0 and I was able to reproduce the problem.
    Is your application project targeting Windows Phone OS 7.0 or 7.1 ?

    If your project targets 7.0 then the WebBrowser control also runs in a backward compatability mode.
    If you require HTML 5 then you should target Windows Phone OS 7.1.
    Monday, February 13, 2012 5:16 PM
  • Eric,

    Thanks so much for following up. I didn't realize that the browser control compatability was causing it!
    Monday, February 13, 2012 9:12 PM