AnsweredAssumed Answered

PictureMarkerSymbol moves with scene and altitude is 0

Question asked by jasonMDSP on Aug 13, 2015
Latest reply on Aug 14, 2015 by jasonMDSP

My code generates a points that has a PictureMarkerSymbol. It is run over and over, and the previously generated graphic is removed and a new one is added (so it looks like the plane is moving, does not have to be a fluent animation).  My issues is that I am able to add the initial heading of the symbol, so it has the correct heading, but the heading never changes afterwards. Also, when I rotate the map, the icon's heading seems to be fixed with the screen (always points to the same place with respect of the screen. Also, the altitude is always touching the ground.

esri1.JPG

esri2.JPG

(same point looked from another angle)

 

How do I make the direction of the icon always point to the real heading, and how can I have some elevation?

My code:

 

var graphicsOverlay = MySceneView.GraphicsOverlays["MyGraphicsOverlay"] as Esri.ArcGISRuntime.Controls.GraphicsOverlay;
if (graphicsOverlay == null)
{
    graphicsOverlay = new GraphicsOverlay();
    graphicsOverlay.ID = "MyGraphicsOverlay";
}

//Convert from latlon to ArcGis Window coordinate
var scenePoint =  new Esri.ArcGISRuntime.Geometry.MapPoint(lon,lat,alt,MySceneView.SpatialReference);
var pointSceneGraphic = new Esri.ArcGISRuntime.Layers.Graphic();
pointSceneGraphic.Geometry = scenePoint;

//set the graphic of the placemarker
Esri.ArcGISRuntime.Symbology.PictureMarkerSymbol imgSym = new Esri.ArcGISRuntime.Symbology.PictureMarkerSymbol();
imgSym.SetSourceAsync(new Uri(iconHref));
imgSym.AngleAlignment = Esri.ArcGISRuntime.Symbology.MarkerAngleAlignment.Map;
imgSym.Angle = platformHeading;
                    
pointSceneGraphic.Symbol = imgSym;

ret = pointSceneGraphic.GetHashCode().ToString();

MySceneView.GraphicsOverlays[0].Graphics.Add(pointSceneGraphic);

foreach (var graphicsObj in graphicsOverlay.Graphics)
{
    if (graphicsObj.GetHashCode().ToString() == oldId)
    {
        graphicsOverlay.Graphics.Remove(graphicsObj);
        break;
    }
}

 

My WPF looks like this

<Grid>
        <esri:SceneView x:Name="MySceneView" Visibility="Visible" LayerLoaded="MySceneView_LayerLoaded"> 
            <esri:Scene>
                <esri:ArcGISTiledMapServiceLayer ID="BaseScene" ResamplingMode="None"
                    ServiceUri="http://services.arcgisonline.com/arcgis/rest/services/World_Imagery/MapServer" /> 
            </esri:Scene>
        </esri:SceneView>
</Grid>

 

Is there a better way to do what I'm doing?

Outcomes