main.qml 593 B

12345678910111213141516171819202122232425262728293031
  1. //import QtQuick 1.0
  2. import QtWebKit 1.0
  3. import Qt 4.7
  4. Item {
  5. function mapHtmlFileName() {
  6. var url = "/htmls/" + cppEngine.mapProvider;
  7. return url;
  8. }
  9. function positionUpdated(lat, lon)
  10. {
  11. mapView.evaluateJavaScript("pan("+lat+","+lon+");");
  12. }
  13. Connections {
  14. target: cppEngine;
  15. onPosUpdated: positionUpdated(lat, lon)
  16. }
  17. WebView {
  18. id: mapView
  19. url: mapHtmlFileName()
  20. preferredWidth: parent.width
  21. preferredHeight: parent.height
  22. scale: 1
  23. smooth: false
  24. }
  25. }