コード例 #1
0
        private void initPlanePathLayer(double coordx, double coordy)
        {
            if (!showPlanePath)
            {
                return;
            }

            //var planePathLayer = MyMap.Layers["UserPlaneRealPath"] as Esri.ArcGISRuntime.Layers.GraphicsLayer;
            var planePathLayer = new Esri.ArcGISRuntime.Layers.GraphicsLayer();

            planePathLayer.ID            = "UserPlaneRealPath";
            planePathLayer.RenderingMode = Esri.ArcGISRuntime.Layers.GraphicsRenderingMode.Dynamic;
            MyMap.Layers.Add(planePathLayer);

            var lineSym = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol();

            lineSym.Color = Colors.Red;
            lineSym.Width = 2;
            lineSym.Style = Esri.ArcGISRuntime.Symbology.SimpleLineStyle.Solid;

            List <Esri.ArcGISRuntime.Geometry.MapPoint> userPlanePositionsList = new List <Esri.ArcGISRuntime.Geometry.MapPoint>();

            userPlanePositionsList.Add(new Esri.ArcGISRuntime.Geometry.MapPoint(coordx, coordy, Esri.ArcGISRuntime.Geometry.SpatialReferences.Wgs84));
            userPlanePositionsList.Add(new Esri.ArcGISRuntime.Geometry.MapPoint(coordx, coordy, Esri.ArcGISRuntime.Geometry.SpatialReferences.Wgs84));


            Esri.ArcGISRuntime.Geometry.Polyline line = new Esri.ArcGISRuntime.Geometry.Polyline(userPlanePositionsList);
            var lineGraphic = new Esri.ArcGISRuntime.Layers.Graphic();

            lineGraphic.Geometry = line;
            lineGraphic.Symbol   = lineSym;
            planePathLayer.Graphics.Add(lineGraphic);

            planePathInitialized = true;
        }
コード例 #2
0
/*        private void AddMarker_Click(object sender, RoutedEventArgs e)
 *      {
 *          //setUserPlaneCoord(36.4, 51.2, 30.0);
 *          centerAtPoint(10.0, 10.0);
 *      }
 */
        private void drawUserPlaneWaypoint()
        {
            var userPlaneWPLayer = MyMap.Layers["UserPlaneWaypoints"] as Esri.ArcGISRuntime.Layers.GraphicsLayer;

            if (userPlaneWPLayer == null)
            {
                userPlaneWPLayer               = new Esri.ArcGISRuntime.Layers.GraphicsLayer();
                userPlaneWPLayer.ID            = "UserPlaneWaypoints";
                userPlaneWPLayer.RenderingMode = Esri.ArcGISRuntime.Layers.GraphicsRenderingMode.Static;
                MyMap.Layers.Add(userPlaneWPLayer);
            }

            var lineSym = new Esri.ArcGISRuntime.Symbology.SimpleLineSymbol();

            lineSym.Color = Colors.Purple;
            lineSym.Width = 3;
            lineSym.Style = Esri.ArcGISRuntime.Symbology.SimpleLineStyle.Solid;

            Esri.ArcGISRuntime.Geometry.Polyline line = new Esri.ArcGISRuntime.Geometry.Polyline(wPoints);
            var lineGraphic = new Esri.ArcGISRuntime.Layers.Graphic();

            lineGraphic.Geometry = line;
            lineGraphic.Symbol   = lineSym;
            userPlaneWPLayer.Graphics.Add(lineGraphic);

            flightPlanInitialized = true;
        }