ToolTipVisible: Boolean;
ToolTipVisible: System.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.
Executing the example requires a form with the UiMapNet component named UiMapNet1 and the MapBoxNet component that is a data source for UiMapNet.
...
Imports Prognoz.Platform.Forms.NET;
Imports Prognoz.Platform.Interop.Metabase;
Imports Prognoz.Platform.Interop.Map;
Imports Prognoz.Platform.Interop.Report;
Public Partial Class OBJ42710Form : Prognoz.Platform.Forms.NET.ForeNetForm
Public Constructor OBJ42710Form();
Begin
InitializeComponent();
End Constructor;
Private Sub mapBoxNet1_Load( sender : System.Object; e : System.EventArgs );
Var
Da: TextDataAdapter;
MapDa: IMapDataAdapter;
M: IMap;
mLayers: IMapLayers;
mLayer: IMapLayer;
mShapes: IMapTopobaseShapes;
mShape: IMapTopobaseShape;
i: integer;
Begin
UiMapNet1.MapUi.Map.Topobase:= Self.Metabase.ItemById ["OBJ160"].Bind() As DXMapTopobase;
Da := New TextDataAdapter.Create();
Da.Str := "This ";
MapDa := Da As IMapDataAdapter;
M := UiMapNet1.Map;
mLayers := M.Layers;
mLayer := mLayers.FindByName["Regions"];
mShapes := mLayer.Shapes;
For i := 0 To mShapes.Count - 1 Do
mShape := mShapes.Item[i];
System.Console.WriteLine(MapDa.Data[mShape]);
End For;
mLayer.ToolTipDataAdapter := MapDa;
mLayer.ToolTipVisible := True;
End Sub;
End Class;
Class TextDataAdapter: Object, IMapDataAdapter
Public Str: String;
Public Property Data[Attribute: Object]: Object
Get
Var
shape: IMapTopobaseShape;
Begin
shape := Attribute As IMapTopobaseShape;
Return Str + shape.Name;
End Get
End Property;
End Class TextDataAdapter;
After executing the example the tooltips are displayed for the Regions map layer.
See also: