ArcObjects Library Reference (Carto)  

IMapServer2.QueryHyperlinks Method

Returns a collection of Map Server Hyperlink objects for the specified layers. Only hyperlinks of visible layers are returned. If LayerIDs is Nothing/Null or empty, all layers are searched.

[Visual Basic .NET]
Public Function QueryHyperlinks ( _
    ByVal mapDesc As IMapDescription, _
    ByVal MapImage As IImageDisplay, _
    ByVal layerIds As ILongArray _
) As IMapServerHyperlinks
[C#]
public IMapServerHyperlinks QueryHyperlinks (
    IMapDescription mapDesc,
    IImageDisplay MapImage,
    ILongArray layerIds
);
[C++]
HRESULT QueryHyperlinks(
  IMapDescription* mapDesc,
  IImageDisplay* MapImage,
  ILongArray* layerIds,
  IMapServerHyperlinks** hyperlinks
);
[C++]

Parameters

mapDesc [in]

  mapDesc is a parameter of type IMapDescription

MapImage [in]

  MapImage is a parameter of type IImageDisplay

layerIds [in]

  layerIds is a parameter of type ILongArray

hyperlinks [out, retval]

  hyperlinks is a parameter of type IMapServerHyperlinks

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Remarks

QueryHyperlinks returns a collection of objects that implement IMapServerHyperlink.

QueryHyperlinks requires a number of input parameters. These include: a MapDescription, ImageDisplay, and LayerID.

MapDescription

The MapDescription contains all the LayerDescriptions in the map. These LayerDescriptions include a DefinitionExpression property. A DefinitionExpression can be set on a layer in order to limit layer features available for display or query. This expression can be set in the source map document as a definition query, or can be set using the DefinitionExpression property. The DefinitionExpression set in the LayerDescription will override any any definition query set in the source map. MapServer QueryHyperlinks results should honor any definition query or DefinitionExpression set on the layer.

ImageDisplay

This is needed to determine whether layers are visible or not based on the current map scale. Layer visibility depends on whether the layer is on or off (the Visible property on ILayerDescription3) or whether the layer is on, but not visible due to scale dependencies (the MinScale and MaxScale properties on IMapLayerInfo2).

Miscellaneous

In some cases, for performance reasons, you may want to adjust the geometry being returned in the QueryHyperlink result. Use ILayerResultOptions to manage this. You can choose to densify or generalize the returned geometry by using GeometryResultOptions. Densification is used to better support clients that do not support Arcs (e.g. Bezier, Circular etc.). Generalization reduces the amount of geography being sent across the network and should lead to better performance. Setting  IncludeGeometry property has no effect, QueryHyperLinks always returns geometry.

Geometry is always returned in the same spatial reference system as the DefaultMapDescription, even though the source data of a layer may be in a different coordinate system.

In order to control the amount of information MapServer needs to process for a query, a maximum number of records can be set. This value is contained in the MaxRecordCount property on IMapServerInit2. The default value for this property is 500. If 600 features match a given query only the first 500 results will be returned. You will be unable to access the remaining 100 records. To be able to access these records the MaxRecordCount would need to be increased to 600. MaxRecordCount can also be changed by modifying the MaxRecordCount XML tag in the MapServer's configuration file.

See Also

IMapServer2 Interface