VERIFIED SOLUTION i
X

How to resolve the default selection not being cleared when a new default selection is selected in MapXtreme .NET

Issue

The default selection is not being cleared when a new default selection is selected in MapXtreme ®, instead an empty result set is being left in the default selection.

Cause

This is a bug MXT-8260.

Resolution

UPDATED: March 2, 2018


This is fixed in the v9.0 release of MapXtreme ®.

Before the v9.0 release there were two workarounds:
  1. Use code to check the DefaultSelection so that it will only process non-empty ResultSets.
  2. Add the FeatureSelected handler ( AddHandler Me.mapCtrl.Tools.FeatureSelected, AddressOf onFeatureSelected) and then remove the empty ResultSets there:
Private Sub onFeatureSelected(sender As System.Object, e As MapInfo.Tools.FeatureSelectedEventArgs)
Dim s As MapInfo.Engine.ISession = MapInfo.Engine.Session.Current
Dim itemsToRemove As MapInfo.Data.MultiResultSetFeatureCollection = New MapInfo.Data.MultiResultSetFeatureCollection
For Each fc As MapInfo.Data.IResultSetFeatureCollection In s.Selections.DefaultSelection
If fc.Count = 0 Then
itemsToRemove.Add(fc)
End If
Next
For Each fc As MapInfo.Data.IResultSetFeatureCollection In itemsToRemove
s.Selections.DefaultSelection.Remove(fc)
Next
End Sub

Environment Details

Products affected: MapXtreme ®.

Downloads

  • No Downloads