Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. QT and Google Maps API 3
Forum Updated to NodeBB v4.3 + New Features

QT and Google Maps API 3

Scheduled Pinned Locked Moved Qt WebKit
5 Posts 2 Posters 3.4k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    fred1983
    wrote on last edited by
    #1

    Hello everybody,

    I want to use googlemap api 3 to display a simple map under an UI developped in QT. For that purpose, I use a Qwebview which load a javascript code as an url. My code works with google api v2 but doesn't display anything with googlemaps api 3. Moreover, when using the javascipt code loaded in a chrome browser, it works fine. Here is the code html :
    @<HTML >
    <HEAD>
    <TITLE>title</TITLE>
    <META http-equiv=Content-Type content="text/html; charset=iso-8859-1">

    [removed][removed]

    [removed]

    function load() {
    

    var optionsCarte = {zoom: 12,center: new google.maps.LatLng(44.843056, -0.644722),mapTypeId: google.maps.MapTypeId.ROADMAP};
    var map = new google.maps.Map(document.getElementById("mapdiv"), optionsCarte);
    }
    [removed]

    <META content="MSHTML 6.00.2900.5848" name=GENERATOR>
    </HEAD>

    <BODY leftMargin=0 topMargin=0 onload=load() onunload=GUnload() >

    <DIV id="mapdiv" ></DIV></BODY></HTML>@

    This code is loaded with the following instructions in QT:
    @ui->webView->setUrl( url );@

    Note that the signal loadFinished of the QwebView returns a false flag.

    Anyone can help me ?

    Thanks,

    1 Reply Last reply
    0
    • E Offline
      E Offline
      eikeR
      wrote on last edited by
      #2

      Can you provide a complete and valid html-page? Delete your personal or confidential stuff, but it must be at least usable to recreate the problem.

      1 Reply Last reply
      0
      • F Offline
        F Offline
        fred1983
        wrote on last edited by
        #3

        Mmmh. I don't understand why the html code is cut...
        Here are the lines not removed (sorry for that problem) before the load function (with the character '<' and '>' correctly set) :

        script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"/script>
        SCRIPT type=text/javascript

        and after the load function (with the character '<' and '>' correctly set):

        /SCRIPT

        I hope it is clear... not sure...

        1 Reply Last reply
        0
        • E Offline
          E Offline
          eikeR
          wrote on last edited by
          #4

          you forgot the ";" (semicolon) behind onload() and GUnload(), maybe QtWebKit is a bit more strict here? write:
          @<BODY onload=load(); onunload=GUnload(); >@

          1 Reply Last reply
          0
          • F Offline
            F Offline
            fred1983
            wrote on last edited by
            #5

            Thank you.
            but still doesn't work...

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved