[Interest] Regarding Map Route navigation

Jha Sonakumar Sona.Jha at TechMahindra.com
Wed Nov 12 07:13:48 CET 2014


Hi,

I have been trying to achieve route navigation, but getting error:


QNetworkReplyImplPrivate::error: Internal problem, this method must only be called once.

QCoreApplication::postEvent: Unexpected null receiver


code-snippets.


import QtQuick 2.0
import QtLocation 5.0
import QtPositioning 5.0

Item {

    property variant start: QtPositioning.coordinate(17.3660, 78.4760)
    property variant end: QtPositioning.coordinate(17.3777, 78.4760)
    property double lats: 17.3660
    property double longs: 78.4760

    Plugin {
        id: myplugin

        name : "nokia"
        parameters: [
            PluginParameter { name: "app_id"; value: "xxx" },
            PluginParameter { name: "token"; value: "xxx" },
            PluginParameter { name: "proxy"; value: "xxxx" }
        ]
    }

   Map {
        id:map
        plugin: myplugin
        anchors.fill: parent


        center {
            latitude:lats
            longitude:longs
        }

        MapCircle{
            id:mapCircle
            center {
                latitude:lats
                longitude:longs
            }

            radius: 1000.0
            color: 'green'
            border.width:1
            opacity: 0.7
        }

        zoomLevel: 35
        gesture.enabled: true

        RouteQuery {
            id: aQuery
        }

        RouteModel {
            id: routeModel
            plugin: myplugin
            query: aQuery
            autoUpdate: false
        }

        MapItemView {
            model: routeModel
            delegate: routeDelegate
        }

        Component {
            id: routeDelegate

            MapRoute {
                route: routeData
                line.color: "blue"
                line.width: 5
                smooth: true
                opacity: 0.8
            }
        }
    }

    MouseArea {
        anchors.fill: parent

        onClicked: {
            console.log("mouse clicked")
            aQuery.clearWaypoints()
            aQuery.addWaypoint(start)
            aQuery.addWaypoint(end)
            aQuery.travelModes = RouteQuery.CarTravel
            aQuery.routeOptimizations = RouteQuery.FastestRoute
            routeModel.update()
        }
    }
}







============================================================================================================================
Disclaimer:  This message and the information contained herein is proprietary and confidential and subject to the Tech Mahindra policy statement, you may review the policy at http://www.techmahindra.com/Disclaimer.html externally http://tim.techmahindra.com/tim/disclaimer.html internally within TechMahindra.
============================================================================================================================

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20141112/cc755a4c/attachment.html>


More information about the Interest mailing list