Пример #1
0
        }         // public static GraphicsLayer reloadRLData(Map map, string layerID, string layerName)

        /// <summary>
        /// Create graphics from xml and restore Symbol for each Graphic in layer
        /// </summary>
        /// <param name="gl">redline layer</param>
        /// <param name="xmlContent">symbols parameters</param>
        public static void restoreRLGraphics(GraphicsLayer gl, string xmlContent)
        {
            // set Graphics symbols
            gl = VLayer.setContent(gl, xmlContent);

            foreach (var gr in gl.Graphics)
            {
                var t = gr.Attributes["aType"] as string;
                ESRI.ArcGIS.Client.Geometry.Geometry g = gr.Geometry;

                if (isText(g, t))
                {
                    gr.Symbol = remakeTextSymbol(gr);
                }
                else if (isPoint(g))
                {
                    gr.Symbol = dicSymbols[t];
                }
                else if (isLine(g))
                {
                    gr.Symbol = dicLineSymbols[t];
                }
                else if (isArea(g))
                {
                    gr.Symbol = dicAreaSymbols[t];
                }
                else
                {
                    (string.Format("restoreRLGraphics, unknown Geom type [{0}]", g.GetType())).clog();
                    continue;
                }
            }
        }         // public static void restoreRLGraphics(GraphicsLayer gl, string xmlContent)
Пример #2
0
        }         // private void editMarker(Graphic gr)

        private void restoreRLLayer(GraphicsLayer gl, string xmlContent)
        {
            // set Graphics symbols
            log("restoreRLLayer, ...");
            gl = VLayer.setContent(gl, xmlContent);

            foreach (var g in gl.Graphics)
            {
                var typ = g.Attributes["aType"] as string;
                currGeom = g.Geometry;
                markType = typ;

                if (isText())
                {
                    g.Symbol = remakeTextSymbol(g);
                }
                else if (isPoint(g.Geometry))
                {
                    g.Symbol = dicSymbols[typ];
                }
                else if (isLine(g.Geometry))
                {
                    g.Symbol = dicLineSymbols[typ];
                }
                else if (isArea(g.Geometry))
                {
                    g.Symbol = dicAreaSymbols[typ];
                }
                else
                {
                    log(string.Format("unknown Geom type [{0}]", g.Geometry.GetType()));
                    continue;
                }

                currGeom = null;
                markType = null;
            }
        }         // private void restoreRLLayer(GraphicsLayer gl, string xmlContent)