WebMapLocation Icon NilObjectException

I have a socket where I receive coordinates.
These coordinates needs to be show on a WebMapViewer.

In the socket DataAvailable event, I have the following code:

Dim loc As New WebMapLocation

loc.Latitude = Val( data( 1 ) )
loc.Longitude = Val( data( 2 ) )
loc.icon = pinRoundRed
loc.Visible = True

MapView.GoToLocation( loc )

I get the NilObjectException.
When I use the same pinRoundRed Icon in the MapView click event, it works.

Sockets fire on the main thread and are not associated with a particular Session. You’ll need to keep track of that and create a Session context before calling MapView.something

I tried this by changing the verticalCenter of the MapView in code.
This gives the MapView CenterChanged event.
Then the loc.icon = pinRoundRed is accepted.

But this also moves the MapView down.
So after some updates, the MapView is halfway the window…