WebView Google Maps panning/dragging in Qt5
Asked Answered
A

1

15

I'm currently porting an application from Qt 4 to Qt 5 and experiencing some problems with the WebView QML element. I can successfully load a Google Maps webpage into a WebView, however the page only responds to single or double-clicks; attempting to click-drag the map view to pan the visible area has no effect.

Previously, with the Qt 4 version of my code, I used the 'pressGrabTime: 0' WebView property and spoofed the user agent in order to achieve the click-drag functionality.

I have been referred to the source code for the MiniBrowser example supplied with Qt 5, which appears to generate mock touch events in order to enable the required functionality. However, the example code makes use of a number of private frameworks which I would ideally like to avoid having to incorporate into my own code.

Can anyone shed some light on why the WebView element does not respond to click-drag events, and suggest a way of overcoming this?

Adjourn answered 5/2, 2013 at 13:18 Comment(0)
S
0

I can't answer your question, but maybe I can give you another solution to your problem.

Google maps gives you map tiles based on long/lat & zoom level, maybe you can make a side request to the neighboring tiles, and stitch them together into the image you want.

Check out tangogps/foxtrotgps, it is open source so you can see what they have done to make the google maps tiles work with there software.

Stanger answered 11/6, 2015 at 3:58 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.