Select to view content in your preferred language

GeoRssLayer Update

694
2
03-16-2011 12:52 PM
DarellStoick
Occasional Contributor
I'v have an active GeoRss Layer on my map and it loads fine. I added a button to force a refresh to get the latest feeds.

When I try to update the GeoRssLayer the graphics are removed, the layer is still visible and the Layer.Graphics.count is never changed.

What an I missing?

Private Sub NewButton_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)
        Dim Layer As GeoRssLayer = TryCast(MyMap.Layers("MyGeoRssLayer"), GeoRssLayer)
        Layer.Update()

    End Sub


Current code is a slightly modified version of this example: http://help.arcgis.com/en/webapi/silverlight/samples/start.htm#GeoRssSimple

Thanks
0 Kudos
2 Replies
DominiqueBroux
Esri Frequent Contributor
If you need the projection provided in the sample, take care that this projection is only done the first time.
To keep the projection active when the graphics are updated, change the code to:

     void _geoRssLayer_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {
            if (e.PropertyName == "Graphics")
            {
               // Comment or remove this line  _geoRssLayer.PropertyChanged -= _geoRssLayer_PropertyChanged;
                updateGeoRssGraphics();
            }
        }
0 Kudos
DarellStoick
Occasional Contributor
ok, I understand. I have the sample workin now. Thanks
0 Kudos