Qt wiki will be updated on October 12th 2023 starting at 11:30 AM (EEST) and the maintenance will last around 2-3 hours. During the maintenance the site will be unavailable.

QML Maps with Pinch Zoom

From Qt Wiki
Revision as of 16:34, 14 January 2015 by Maintenance script (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

English | Български

QML Map using PinchArea to zoom and MouseArea to pan

Qt Mobility’s Location plugin provides a very nice QML Map item, but currently leaves navigation up to the developer to implement. Two common navigation methods are using a swipe gesture to pan the map around and using a pinch gesture to zoom in and out.

Having not found any solid examples of how to do these two things together, I thought I would post an example of some code which implement these two features. The code uses the PinchArea [doc.qt.nokia.com] element which was introduced in Qt Quick 1.1.

I hope you find this helpful!

Categories: