Hi,

I ran you snippet as is. My only change was to remove the proxy line. The app 
works and map, route and circle behave as expected. Since this is a network 
error maybe the proxy is related to the error but I have no proxy to test this 
with. Did you try without a proxy?


I used Qt 5.4 to test this.


--

Alex

________________________________
From: interest-bounces+alexander.blasche=theqtcompany....@qt-project.org 
<interest-bounces+alexander.blasche=theqtcompany....@qt-project.org> on behalf 
of Jha Sonakumar <sona....@techmahindra.com>
Sent: Wednesday, November 12, 2014 07:13
To: interest@qt-project.org Interest
Subject: [Interest] Regarding Map Route navigation


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.
============================================================================================================================
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to