[Solved] QWebView 64bit javascript problem



  • I'm using Qt in Visual Studio 2010 and in a QWebView i load the following HTML-Code to show a dynamic Bing Map
    @//------------------------------------------HTML FILE-------------------------------------------------
    #define MAP_HTML "<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title></title>"
    "<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>"
    "[removed][removed][removed]"
    "var map = null;"
    "function viewChanged(){MobileDataVisualAnalyticsMap.loaded()}"
    "function viewChangeStarted(){MobileDataVisualAnalyticsMap.viewChangeStart()}"
    "function mouseMoved(e){if (e.targetType == "map") {var point = new Microsoft.Maps.Point(e.getX(), e.getY());var loc = e.target.tryPixelToLocation(point);MobileDataVisualAnalyticsMap.mouseMoved(loc.latitude, loc.longitude);e.handled = false;}}"
    "function clicked(e){MobileDataVisualAnalyticsMap.mapClick(); e.handled = false;}"
    "function GetMapByBounds(northWestLatitude, northWestLongitude, southEastLatitude, southEastLongitude, mapType){"
    "var boundingBox = Microsoft.Maps.LocationRect.fromLocations(new Microsoft.Maps.Location(northWestLatitude,northWestLongitude), new Microsoft.Maps.Location(southEastLatitude,southEastLongitude));"
    "map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),{credentials: "KeyDeleted","
    "bounds: boundingBox, mapTypeId: mapType, enableSearchLogo: false, enableClickableLogo: false, showScalebar: false, showCopyright: false, showDashboard:false});"
    "Microsoft.Maps.Events.addHandler(map, 'viewchangeend', viewChanged); "
    "Microsoft.Maps.Events.addHandler(map, 'viewchangestart', viewChangeStarted); "
    "Microsoft.Maps.Events.addHandler(map, 'mousemove', mouseMoved); "
    "Microsoft.Maps.Events.addHandler(map, 'click',clicked);"
    "}"
    "function GetMap(latitude, longitude, zoomfactor, mapType, mapHeading){"
    "map = new Microsoft.Maps.Map(document.getElementById("mapDiv"),{credentials: "KeyDeleted","
    "center: new Microsoft.Maps.Location(latitude,longitude),mapTypeId: mapType,zoom: zoomfactor, enableSearchLogo: false, enableClickableLogo: false, showScalebar: false, showCopyright: false, showDashboard:false, heading: mapHeading});"
    "Microsoft.Maps.Events.addHandler(map, 'viewchangeend', viewChanged); "
    "Microsoft.Maps.Events.addHandler(map, 'viewchangestart', viewChangeStarted); "
    "Microsoft.Maps.Events.addHandler(map, 'mousemove', mouseMoved); "
    "Microsoft.Maps.Events.addHandler(map, 'click',clicked);"
    "}"
    "[removed]</head>"
    "<body onload="GetMap(46.5269,6.56573, 15, Microsoft.Maps.MapTypeId.road, 0);">"
    "<div id="mapDiv" style="width:100%; height:100%"></div>"
    "</body></html>"

    //----------------------------------------END OF HTML FILE-------------------------------------------@

    Under the 32 bit version of the QWebView zoom and pan works fine with every zoom factor. Now i changed to the 64 bit version of Qt and the map is loading perfectly above zoom factor 15, which is the default-value by loading the html. I can zoom in and pan around, all works fine. If i zoom out (zoom factor < 15) the map does not render more than i see with zoom factor 15. So i have a grey border around the map, which is expanding if i zoom more out. If i pan around the map acts like a static map and shows always the same pane.
    Changing the default value of the zoom factor didn't change anything. If i take for example zoom factor 10 the map doesn't show anything till i zoom in and reach zoom factor 15.
    Under the 32 bit version of Qt all works fine, its just the 64 bit version that shows this behaviour.
    Does anyone have an idea about this?

    Best regards from Germany

    Theo Rehm



  • Seems to be a problem with VS2010 x64 build.
    With x86 build of VS2010 both versions (64 bit - 32 bit) of Qt work fine with the bing map. With the x64 build both versions show the issue descriped above.
    Any ideas?



  • Small addition: Neither the aerial, nor the birdseye view shows anything. Only the road map works above zoom factor 15. :-/



  • Solved it! :-D
    The problem was, that QWebView didn't show GIF and/or JPEG images.
    Solution:

    1. In the directory where your Qt application is located, create a subdirectory with imageformats name.
    2. Copy the image plug-ins from the following directory: $(QTDIR)\plugins\imageformats

  • Moderators

    Good job!

    Thanks for sharing your solution.

    Could you please edit your first post and add [solved] in the title? Thanks.



  • @Eddy: Done. ;-)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.