Graphic Point Does Not Display

2511
1
12-15-2015 04:03 PM
GreggCountryman1
New Contributor

Hello,

I have a simple map containing a Tiled Layer, and a cashed layer. When I add a Graphic Point, it will only display if I do not load the Tiled Service.

Here is the code:

                var streetsCacheLayer = new ArcGISTiledMapServiceLayer(new Uri(streetsCacheUrl));

                streetsCacheLayer.MaxScale = 36111;

                var streetsDynamicLayer = new ArcGISDynamicMapServiceLayer(new Uri(streetsDynamicUrl));

                var graphicsLayer = new Esri.ArcGISRuntime.Layers.GraphicsLayer();

                graphicsLayer.ID = "MyGraphics";

                var mapPoint = new MapPoint(-76.644759, 39.516597);

                var depotSym = new SimpleMarkerSymbol { Style = SimpleMarkerStyle.Circle, Size = 16, Color = Colors.Green };

                var depotMapGraphic = new Graphic { Geometry = mapPoint, Symbol = depotSym };

                graphicsLayer.Graphics.Add(depotMapGraphic);

                 await streetsCacheLayer.InitializeAsync();

                await streetsDynamicLayer.InitializeAsync();

                await graphicsLayer.InitializeAsync();

                // If I comment out the next line the graphic shows up, otherwise it does not.

                MyMap.Layers.Add(streetsCacheLayer);

                MyMap.Layers.Add(streetsDynamicLayer);

                MyMap.Layers.Add(graphicsLayer);

Any ideas?

Thanks,

Ed

0 Kudos
1 Reply
AnttiKajanus1
Occasional Contributor III

Hi,

My guess is that the tile layer is in different SpatialReference. Can you make sure that you use the same SR for the graphic too.

0 Kudos