Select to view content in your preferred language

LineSymbol and SimpleLineSymbol not rendering without AcceleratedDisplay

6332
14
04-19-2013 10:35 AM
AaronHigh
Deactivated User
Hello,

I'm working through some performance issues with the accelerated display and have switched to working without it enabled. With the AcceleratedDisplay enabled, SimpleLineSymbols and LineSymbols both render correctly. If I turn it off, both fail to render completely. Nothing else has changed such as their geometries or symbologies. Is this a known issue and/or am I doing something wrong? Additionally, SimpleFillSymbols, PictureMarkerSymbols, and TextSymbols seem to work just fine regardless of AcceleratedDisplay settings.

Thanks.

EDIT: Code sample below

private void MakeSimpleSymbol()
{
            //Create a simple line symbol
            SimpleLineSymbol sls = new SimpleLineSymbol();
            sls.Color = new SolidColorBrush(Colors.Blue);
            sls.Style = SimpleLineSymbol.LineStyle.Solid;
            sls.Width = 2;

            //Create a polygon object
            Polygon p = new Polygon();
            p.SpatialReference = new SpatialReference(102100);

            //Populate it with some points
            ESRI.ArcGIS.Client.Geometry.PointCollection pointCollection = new ESRI.ArcGIS.Client.Geometry.PointCollection();
            ObservableCollection<ESRI.ArcGIS.Client.Geometry.PointCollection> rings = new ObservableCollection<ESRI.ArcGIS.Client.Geometry.PointCollection>();
            MapPoint wgsPoint = new MapPoint(0,0);
            MapPoint wgsPoint2 = new MapPoint(50,0);
            MapPoint wgsPoint3 = new MapPoint(0,50);
            pointCollection.Add(wgsPoint);
            pointCollection.Add(wgsPoint2);
            pointCollection.Add(wgsPoint3);
            rings.Add(pointCollection);
            p.Rings = rings;

            //Create a graphic and set its properties
            Graphic graphic = new Graphic();
            graphic.Geometry = p;
            graphic.Symbol = sls;

            //Create a graphics layer and add the graphic to it
            GraphicsLayer gLayer = new GraphicsLayer();
            gLayer.Graphics.Add(graphic);

            //Add the graphics layer to the map
            _map.Layers.Add(gLayer);
}


And in the XAML:
<Window x:Class="ESRIWPFTestApplication.MainWindow"
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:esri="http://schemas.esri.com/arcgis/client/2009"
        Title="MainWindow" Height="350" Width="525">
    <Grid>
        <!-- AcceleratedDisplay is OFF -->
        <esri:Map x:Name="_map" UseAcceleratedDisplay="False">
        </esri:Map>
    </Grid>
</Window>
0 Kudos
14 Replies
AnkitaBhatia
Occasional Contributor
Hi Mike!
Strangely when I don't use the geometry returned by Draw object and create my own geometry,using the start and end point as the connected points, the line is not shown.

I drag my line from one symbol to another but the line does not appear.
0 Kudos
AnkitaBhatia
Occasional Contributor
Hi Mike!
I got this to work by explicitly calling the Complete Draw on MouseUp of the map and finding the Graphic on the clicked location.
Thanks for helping me out:)
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
That's great news, thanks for the update.

Cheers

Mike
0 Kudos
AnkitaBhatia
Occasional Contributor
Mike,
I would like to understand why a geometry drawn with the Draw object behaved differently. According to me, it would have taken the location i was clicking on and on zoom both the graphic and the endpoint of the line would have moved equally.
Thus giving me an appearance like I am getting now.

Is there an explanation I am not able to figure out?
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
I'm not aware of anything in the API that would account for this (e.g. some form of scale-dependent precision) but my initial reaction is that perhaps it's something as simple as when digitizing you're at a sufficiently small scale to make the end of the line appear coincident with the point but in reality it's 100s/1000s metres away?

Cheers
0 Kudos