Results 1 to 4 of 4

Thread: QWebView Problem Drag&Drop Markers in Google Maps

  1. #1
    Join Date
    Dec 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default QWebView Problem Drag&Drop Markers in Google Maps

    Hi,
    i try to show Google Maps in a QWebView (this works) and to play around with a marker. The html code for the WebView is:
    Qt Code:
    1. <html>
    2. <head>
    3. <script type="text/javascript" src="http://www.google.com/jsapi?autoload={'modules':[{name:'maps',version:3,other_params:'sensor=false'}]}"></script>
    4. <script type="text/javascript">
    5. function initialize() {
    6. var latlng = new google.maps.LatLng(-34.397, 150.644);
    7. var myOptions = {
    8. zoom: 8,
    9. center: latlng,
    10. mapTypeId: google.maps.MapTypeId.ROADMAP,
    11. mapTypeControlOptions: {
    12. style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
    13. },
    14. navigationControlOptions: {
    15. style: google.maps.NavigationControlStyle.ZOOM_PAN
    16. },
    17. scaleControl: true
    18. };
    19. var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    20. var distanceWidget = new DistanceWidget(map);
    21. }
    22.  
    23. function DistanceWidget(map) {
    24. this.set('map', map);
    25. this.set('position', map.getCenter());
    26. var marker = new google.maps.Marker({
    27. draggable: true,
    28. title: 'Move me!'
    29. });
    30. // Bind the marker map property to the DistanceWidget map property
    31. marker.bindTo('map', this);
    32. // Bind the marker position property to the DistanceWidget position
    33. // property
    34. marker.bindTo('position', this);
    35. }
    36. DistanceWidget.prototype = new google.maps.MVCObject();
    37. </script>
    38. </head>
    39.  
    40. <body onload="initialize()">
    41. <div id="map_canvas" style="width: 100%; height: 100%"></div>
    42. </body>
    43. </html>
    To copy to clipboard, switch view to plain text mode 

    My problem is that in the WebView i can not drag & drop the marker, with the Fancy Browser example of QT its the same.
    If I try to load the page with IE, Firefox or Chrome it works as supposed.
    Some one know what i can do or where is the problem?

    Thanks,
    Marc

  2. #2
    Join Date
    Apr 2010
    Location
    Portland, OR
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWebView Problem Drag&Drop Markers in Google Maps

    Marc, I have the same problem here. Worked with Google's API V2, not with V3. Did you find a solution to this?

    Thanks,

    Holger

  3. #3
    Join Date
    Apr 2011
    Posts
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QWebView Problem Drag&Drop Markers in Google Maps

    I have the same pb, did you solve it ?
    Thank you very much !

    Olivier

  4. #4
    Join Date
    Apr 2010
    Location
    Portland, OR
    Posts
    6
    Thanks
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QWebView Problem Drag&Drop Markers in Google Maps

    For a while I had a solution: pointed to the Google Maps API v.3.1. Now they retired it, and we're back to broken maps. The only solution I am aware of right now is to recompile QtWebKit, with the flag ENABLE_TOUCH_EVENTS=0 (that's in the .pri). I believe it needs a commercial license to do that legally. Our build engineer tried that and it didn't build. We're going to try it again though.

    Let me know if you find something out, too please!

    Holger

    Quote Originally Posted by nuage125 View Post
    I have the same pb, did you solve it ?
    Thank you very much !

    Olivier

Similar Threads

  1. Mercator for google static maps
    By daarsh in forum Qt Programming
    Replies: 6
    Last Post: 29th September 2010, 11:43
  2. HTML5 Drag and Drop problem in QWebView
    By chenff in forum Qt Programming
    Replies: 0
    Last Post: 10th April 2010, 18:17
  3. Google Maps API and Qt 4 desktop app integration
    By udit in forum Qt Programming
    Replies: 6
    Last Post: 4th September 2009, 19:03
  4. Map is not displayed from maps.google.com
    By abhilashajha in forum Qt Programming
    Replies: 2
    Last Post: 11th June 2009, 14:19
  5. Drag&Drop problem
    By m1k3l3 in forum Qt Programming
    Replies: 4
    Last Post: 26th September 2008, 12:07

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.