Map Tips


This code demonstrates how to create a custom map tip tool for displaying more than a single attribute when hovering over a feature. This class is set up to display attribute values from two fields, but it could be modified to show additional fields, images, etc. The code is looking for a layer called "Pipes" and the fields "Tag" and "PIP_Material_CD", alter these strings to match your data.

How to use:
  1. Change the layer to use from "Pipes" to a layer you want to search on. Also update the fields to list from "Tag" and "PIP_MATERIAL_CD" to something suitable for your data. Recompile the project.
  2. Start ArcMap and add your layer to the map.
  3. Browse and select the MapTips.dll using the 'Add From File' button on the customization dialog.
  4. From the 'Developer Samples' commands category, add the 'Map Tip' command to an existing toolbar.
  5. Activate the tool, then move the cursor over features in the layer.


Requires: Map Layer

Difficulty: Advanced

Visual Basic
File Description
MapTips.frm Form with a picture box for displaying the map tip.
frmResources.frm Form containing tool icon.
MapTip.cls Class file containing map tip code.
MapTips.vbp Project file.
MapTips.dll The compile project.

Key CoClasses: FeatureLayer, Fields, SpatialFilter
Key Interfaces: IFeatureLayer, IFields, ISpatialFilter
Key Members: IFeatureLayer::Search, IFields::FindField, ISpatialFilter::Geometry, ISpatialFilter::SpatialRel