ToolTipVisible: Boolean;
The ToolTipVisible property determines whether tooltips are displayed for the selected map layer.
If the property is set to True, the tooltips for the selected layer are displayed.
Executing the example requires a form with the UiMap component named UiMap1 and the MapBox component, that is a data source for UiMap.
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 OBJ42719Form: Form
UiMap1: UiMap;
MapBox1: MapBox;
Sub OBJ42719FormOnCreate(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("OBJ160").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 OBJ42719FormOnCreate;
End Class OBJ42719Form;
After executing the example the tooltips are displayed for the Regions map layer.
See also: