This document is archived and information here might be outdated. Recommended version. |
Indicates whether the selection buffer should be displayed.
[Visual Basic .NET]
Public Property ShowSelectionBuffer As Boolean
[C#]
public bool ShowSelectionBuffer {get; set;}
[C++]
HRESULT get_ShowSelectionBuffer(
Boolean* Show
);
[C++]
HRESULT put_ShowSelectionBuffer(
VARIANT_BOOL Show
);
[C++] Parameters Show [out, retval]
Show is a parameter of type bool* Show [in]
Show is a parameter of type bool
The selection buffer is based on Euclidian distance. The accuracy of the buffer is dependent on the spatial reference used in the map. An inappropriate spatial reference will result in inaccurate buffer distances. For best results, the map should be in an appropriate spatial reference.
In order to control the amount of information MapServer needs to process for a buffer, a maximum number of records to be buffered can be set. This value is contained in the MaxBufferCount property. The default value for this property is 100. If the number of features to be buffered exceeds MaxBufferCount no features will be buffered. The MaxBufferCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.
The following sample code shows how to create a buffer around selected features. It assumes that you already have a valid MapServer and MapDescription object.
IMapServer mapServer;
IMapDescription mapDesc;
// Select all features in layer 0
string strMapName = mapDesc.Name;
int layerID = 0;
IFIDSet FIDs = mapServer.QueryFeatureIDs(strMapName, layerID, null);
// Create buffer around selected feature
ILayerDescription layerDesc = mapDesc.LayerDescriptions.get_Element(layerID);
layerDesc.SelectionFeatures = FIDs;
layerDesc.SelectionBufferDistance = 1; // map units
layerDesc.ShowSelectionBuffer = true;