summaryrefslogtreecommitdiffstats
path: root/examples/declarative/webview/content/Mapping/Map.qml
blob: 5d3ba818e7fd3868b544fae514f9aacdd63b2a3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import Qt 4.7
import org.webkit 1.0

Item {
    id: page
    property real latitude: -34.397
    property real longitude: 150.644
    property string address: ""
    property alias status: js.status
    WebView {
        id: map
        anchors.fill: parent
        url: "map.html"
        javaScriptWindowObjects: QtObject {
            id: js
            WebView.windowObjectName: "qml"
            property real lat: page.latitude
            property real lng: page.longitude
            property string address: page.address
            property string status: "Loading"
            onAddressChanged: { if (map.url != "" && map.progress==1) map.evaluateJavaScript("goToAddress()") }
        }
        pressGrabTime: 0
        onLoadFinished: { evaluateJavaScript("goToAddress()"); }
    }
}