ToolTipVisible: Boolean;
The ToolTipVisible property determines whether tooltips are displayed for the selected map layer.
Available values:
True. Tooltips for the selected layer will be displayed.
False. Tooltips for the selected layer will not be displayed.
Executing the example requires a form with the following components: the Button component named Button1, the MapBox component named MapBox1, and the UiMap component named UiMap1. UiMap1 is a data source for MapBox1. The map must be connected to the UiMap1 component.
Add links to the ExtCtrls, Forms, and Map system assemblies.
Class TextDataAdapter: Object, IMapDataAdapter
Public Str: String;
Function Get_Data(Attribute: Variant): Variant;
Var
shape: IMapTopobaseShape;
Begin
shape := Attribute As IMapTopobaseShape;
Return Str + shape.Name;
End Function Get_Data;
End Class TextDataAdapter;
Class TestForm: Form
UiMap1: UiMap;
MapBox1: MapBox;
Sub TestFormOnCreate(Sender: Object; Args: IEventArgs);
Var
Da: TextDataAdapter;
MapDa: IMapDataAdapter;
M: IMap;
mLayers: IMapLayers;
mLayer: IMapLayer;
mShapes: IMapTopobaseShapes;
mShape: IMapTopobaseShape;
i: Integer;
Begin
UiMap1.Map.Topobase:= MetabaseClass.Active.ItemById("Map").Bind As IMapTopobase;
Da := New TextDataAdapter.Create;
Da.Str := "This ";
MapDa := Da As IMapDataAdapter;
M := UiMap1.Map;
mLayers := M.Layers;
mLayer := mLayers.FindByName("Regions");
mShapes := mLayer.Shapes;
For i := 0 To mShapes.Count - 1 Do
mShape := mShapes.Item(i);
Debug.WriteLine(MapDa.Data(mShape));
End For;
mLayer.ToolTipDataAdapter := MapDa;
mLayer.ToolTipVisible := True;
End Sub TestFormOnCreate;
End Class TEstForm;
After executing the example a tooltip is displayed for the Regions map layer.
See also: