Select to view content in your preferred language

TimeSlider initialization

1671
1
10-07-2013 12:23 PM
FrancoisGilbert
Deactivated User
Hello,

I am using the example from Dominique that is located here: "http://broux.dominique.free.fr/Silverlight/InteractiveSDK/Default.htm#AutoTimeSliderSample". instead of having them defined in the XAML code, I would like to add the maps in the code behind in vb.net. The problem that I have is for the time enabled layer. As the map are added after the "InitializeComponent" is run, the initTimeSlider function is never called and I do not get the time slider displayed the first time the application starts. Do you have a solution for that.

Public Sub OnMapChanged(oldValue As Map, newValue As Map)
            Try
                If oldValue IsNot Nothing Then
                    DetachLayersHandler(oldValue.Layers)
                End If

                If newValue IsNot Nothing Then
                    AttachLayersHandler(newValue.Layers)
                    InitTimeSlider()
                    newValue.TimeExtent = Value
                End If
            Catch ex As Exception
                MessageBox.Show(ex.Message)
            End Try

        End Sub
0 Kudos
1 Reply
FrancoisGilbert
Deactivated User
A hint to the solution of adding dynamically a time layer. The problem is after adding the time enabled layer, when the program goes to the InitTimeSlider function, the layer is not initialyzed the function exits. I need to know how to add a new time layer and make sure this one is initialyzed when the timeslider function are called.


Private Sub InitTimeSlider(timeExtent As TimeExtent, oTimeInterval As TimeSpan, dtMiddleValue As DateTime)
            Try
                Dim timeSlider = Me
                If timeExtent Is Nothing Then
                    timeSlider.Visibility = Visibility.Collapsed
                    timeSlider.IsPlaying = False
                    Return
                End If

end Sub
0 Kudos