Select to view content in your preferred language

How to add Graphic Attributes in Qml

3098
3
Jump to solution
09-30-2015 07:56 AM
Haider_AliFaheem
Emerging Contributor

I am trying to create the navigation application with offline routing .i want to add the bearing value of GPS point so route will be calculated in the direction of the vehicle. i have sample code from android so could anybody have idea how to do it in QML

Map<String,Object> attributes = new HashMap<String,Object>();

attributes.put("CurbApproach", CurbApproach.Right.value); // set right side curb approach

if(item.GPSLocation!=null && item.GPSLocation.hasBearing())

{

  attributes.put("Bearing", item.GPSLocation.getBearing());

  attributes.put("BearingTol", 30); // bearing tolerance 30
}

StopGraphic stop = new StopGraphic(item.geometry,attributes);

Thanks

Haider

Tags (3)
1 Solution

Accepted Solutions
LucasDanzinger
Esri Frequent Contributor

Going with what Alex suggested, you should be able to obtain the bearing through position source. Position Source is a QML type that will allow you to gather the current coordinate. From the coordinate, you can obtain the bearing. Please see the help from Qt regarding the coordinate QML type - coordinate QML Basic Type | Qt Positioning 5.5

azimuthTo()

real azimuth(coordinate other)

Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.

View solution in original post

3 Replies
AlexanderNohe1
Honored Contributor

Hi Haider Ali Faheem

This is something that would be achieved from taking the position source (pure QML) and getting the position property from it which contains a direction property.  The following documentation you may find helpful:

Position QML Type | Qt Positioning 5.5

PositionSource QML Type | Qt Positioning 5.5 

0 Kudos
Haider_AliFaheem
Emerging Contributor

Hello Alexander,

Thanks a lot for your reply but i think you don't get the idea. i want to adjust the bearing value from GPS Signal to the stop attribute so route is always calculated in direction of vehicle is moving.

that functionality is available on Arcgis desktop but i am not sure it is available on Qt and other mobile platforms.

please check the bearing and bearing tolarance functionlity on arcmap desktop

What are Bearing and BearingTol fields?—Help | ArcGIS for Desktop

0 Kudos
LucasDanzinger
Esri Frequent Contributor

Going with what Alex suggested, you should be able to obtain the bearing through position source. Position Source is a QML type that will allow you to gather the current coordinate. From the coordinate, you can obtain the bearing. Please see the help from Qt regarding the coordinate QML type - coordinate QML Basic Type | Qt Positioning 5.5

azimuthTo()

real azimuth(coordinate other)

Returns the azimuth (or bearing) in degrees from this coordinate to the coordinate specified by other. Altitude is not used in the calculation.