ThinkGeo.com    |     Documentation    |     Premium Support

V 12.3.2 Refresh not working?

In version 12.2.22 mapview. Refresh wordt perfectly in our application, changes in our (inmemory) layers are reflected correctly.

In version V 12.3.2 however, mapview.refresh doesnt seem to do anything. Changes are only reflected after zooming / panning.

Is there a breaking change in this command ? We don’t change the code, just the version of Thinkgeo.

Hey,
I did some test. It works fine. I attached you the demo. I added a button to add a new feature to inmemory layer then call map.Refresh. The new feature will show up on the map without panning or zooming.
Demo.zip (11.6 KB)

Thanks

Frank

Hi,

I am using the WPF version, your demo is on Winforms.
Can’t run it either because the VS Desigenr generates an error.

Thanks,
I created the wpf sample for you. It works fine.
WpfApp40.zip (11.2 KB)
Please let us know if this works on your environment.

Thanks

Frank

Your example works correctly, so i have to investigate on my end. Obviously something changed when updating from 12.2.22 (working correctly) to 12.3.2.

Thanks,
Yes. 12.2.22 to 12.3.2 has some breaking changes. We did some enhancement for the multiple threading stuff. If you could isolate the issue with a simple project. That will be very helpful for us to look into more details.

Thanks

Frank

We are testing a wrapper class around the standard control. I created a test project, where can i send it ?

Hey,
You can send it to the support@thinkgeo.com

Thanks

Frank

ok it is on its way.

Thanks,
We looked into the detail after you remove the inmemory layer you need call
Me.Refresh() to apply the removal.

Here is the full code sample

 Private Sub DeleteTempHighlight()

        Dim LayertoErase As Integer = -1


        For c = 0 To MapHighlightOverlay.Layers.Count - 1

            If MapHighlightOverlay.Layers(c).Name = "TEMPHIGHLIGHT" Then
                LayertoErase = c
                Exit For

            End If


        Next

        If Not LayertoErase = -1 Then MapHighlightOverlay.Layers.RemoveAt(LayertoErase)

        Me.Refresh()
    End Sub

Thanks

Frank

After some more investigation (the problem persisted in our code when drawing new highlights), it seems that you have to call Refresh after each change.

In the 12.2.2 code we had this and it was working fine :

....
    MapHighlightOverlay.Layers.Add(Highlight)
 End If

 _mapview.Overlays.MoveToTop(MapHighlightOverlay)
 _mapview.Refresh() 

in 12.3.2 we had to add a refresh immediatly after adding the layer to the overlay, otherwise when refreshing later (after the overlay move to top), the changes in the layer would only be reflected after a zoom, and not on calling Refresh by code.

....
    MapHighlightOverlay.Layers.Add(Highlight)
    _mapview.Refresh()
 End If

 _mapview.Overlays.MoveToTop(MapHighlightOverlay)
 _mapview.Refresh() 

Is this by design ? Doesn’t seem very efficient.

Hey,
This is not by design. We should not need refresh every time after we remove the InMemory layer. I am still looking into more detail why this happen for 12.3.x

Meanwhile I think the best way for your case. You don’t need delete the InMemorylayer. You just need get the InMemorylayer by the name and clear the items in the InternalFeatures. This will be more efficient Here is the code.

  Public Sub ShowHighlighted(ByVal Features As Collection(Of Feature))
        Dim Highlight = GetTempHighlight()
        Highlight.InternalFeatures.Clear()
        If Not IsNothing(Features) Then
            For Each f In Features
                Highlight.InternalFeatures.Add(f)
            Next
        End If
    End Sub

    Public Function GetTempHighlight() As InMemoryFeatureLayer
        For c = 0 To MapHighlightOverlay.Layers.Count - 1
            If MapHighlightOverlay.Layers(c).Name = "TEMPHIGHLIGHT" Then
                Return MapHighlightOverlay.Layers(c)
                Exit For
            End If
        Next

        Dim Highlight = New InMemoryFeatureLayer()
        Highlight.Name = "TEMPHIGHLIGHT"
        Highlight.ZoomLevelSet.ZoomLevel01.DefaultPointStyle = New PointStyle(PointSymbolType.Circle, 12, GeoBrushes.Red, GeoPens.White)
        Highlight.ZoomLevelSet.ZoomLevel01.DefaultAreaStyle = New AreaStyle(GetLineStyleHighlight)
        Highlight.ZoomLevelSet.ZoomLevel01.DefaultLineStyle = New LineStyle(GetLineStyleHighlight)
        Highlight.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20
        MapHighlightOverlay.Layers.Add(Highlight)
        Return Highlight
    End Function

Thanks

Frank

Hi Frank,

Any news on this issue ?

Thanks,
I compared with the different version. This was caused by some multiple threading enhancement. I am still looking into the root reason for this one.

Thanks

Frank

Thanks,
We have fix this issue. Could you please try with mapsuite V12 latest beta NuGet package tomorrow. The nightly build process will push the fix the beta release tonight.

Thanks

Frank