Hi
Most of these I already use. Since Camera object is immutable I create Camera each time gpsCoords arrive.
This is short version of my function, currFlatPoint is for currPositionGraphic marker and for distance calculation, currPoint is for camera with addidtional z coordinate
function gpsCoord(latitude,longitude,direction,speed) {
if(!currPoint && sceneView.drawStatus!=Enums.DrawStatusCompleted)
return;
currPoint=ArcGISRuntimeEnvironment.createObject("Point", {x:longitude, y:latitude,z:point_z[curr_z_idx], spatialReference: mapPage.spat_ref});
currFlatPoint=ArcGISRuntimeEnvironment.createObject("Point", {x:longitude, y:latitude, spatialReference: mapPage.spat_ref});
if(speed>=2) {
mapPage.heading=direction //dont rotate on low speed
}
camera=ArcGISRuntimeEnvironment.createObject("Camera",{pitch:pitch,roll:0,heading:mapPage.heading,location:currPoint,distance:camera_z[curr_z_idx]});
sceneView.setViewpointCameraAndSeconds(camera,cam_speed)
}
I'm changing variable curr_z_idx depending on how far from the next maneuver, I want camera to be closer when approaching turn (or any maneuver). By trial and error I came up with these values for currPoint z variable and Camera distance
property var point_z:[150,100,70,30]
property var camera_z:[450,350,250,150]
property int curr_z_idx:0_
So, to show whole route I need to get center point of the route, put camera with 0 pitch and some heading and some "distance" value, distance must be large enought to show whole route. I'm not sure how to calculate distance, I could use some trigonometric functions, had I known camera angle of view, but I don't
As You can see there is also an issue with tiles, with MapView they refresh much faster.
Best,
Marek