Map.Layers.SelectedLayer

Developer
Feb 25, 2011 at 10:21 PM

The IMapLayerCollection has a property SelectedLayer. This is the layer, which is highlighted in the legend. Having a property "SelectedLayer"  indicates that only one layer can be selected at one time. Otherwise, the property would be called "SelectedLayers".

However, there is an inconsistency in the current DotSpatial implementation. The Layer class has a property "IsSelected". Programmatically I can set the "IsSelected" property to true for more layers which results in the highlighting of more than one layer in the legend.

What is the intended design here:

  1. Allow only one selected layer - then I suggest changing the Layer.IsSelected property to "ReadOnly" and make the MapFrame responsible for managing the SelectedLayer
  2. Allow multiple selected layers - then I suggest adding a property MapFrame.SelectedLayers which will give us the full list of currently selected layers.

Any suggestions from the group?

Jiri

Developer
Mar 9, 2011 at 4:14 PM

It does seem potentially more powerful to allow more than one layer to be selected, but also more confusing in some cases.

When I am selecting shapes in a shapefile, which layer am I selecting from?

There was some work in MW4 to allow selection to work in multiple layers, so looking at that work might be helpful.