Displaying Geodesic Ellipse with Graphics Layer

04-18-2017 03:10 PM
New Contributor II

I'm trying to write a simple function that draws ellipses at certain device locations as seen in my code below.  

void theellipse(const mn:: Point deviceLocation,mn::SceneGraphicsView* m_sceneView,QColor lineColor,mn::GraphicsOverlay* ellipseGraphicOverlay, MapRay *thisF)
    const mn::Point normalizedPt = mn::GeometryEngine::normalizeCentralMeridian(deviceLocation);
    mn::GeodesicEllipseParameters parameters(/*angle*/90,mn::AngularUnit(mn::AngularUnitId::Degrees),normalizedPt,
                   /*unit*/ mn::LinearUnit(mn::LinearUnitId::Kilometers),
mn::PolygonBuilder PolygonBuilder(m_sceneView->spatialReference());
mn::Polygon ellipse1= mn::GeometryEngine::ellipseGeodesic(parameters);

It's not clear for me through looking at documentation how to turn geodesic ellipse parameters into scene symbols that are graphic layers. 
Any help would be much appreciated. Thanks.

0 Kudos
2 Replies
Esri Contributor

Hi Mike,

You can use the type returned by ellipseGeodesic (in this case a Polygon) as the geometry for a Graphic and then add the graphic to the GraphicsOverlay. To symbolise the graphic in the overlay you can either set a Symbol directly or set a Renderer using a symbol for the entire overlay.

If you take a look at these two samples from our github repository you should see some examples of different approaches to displaying graphics:

arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Renderer at v.next... 

arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/DisplayInformation/Simple_Marker_Symbol at v... 

this sample shows the use of symbols in a scene:

arcgis-runtime-samples-qt/ArcGISRuntimeSDKQt_CppSamples/Scenes/Symbols at v.next · Esri/arcgis-runti... 

I hope that helps,


0 Kudos
New Contributor II

I will look into this. 

Thanks Luke,


0 Kudos