Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

TdxCustomMapItemLayer.AddItem(TdxMapItemClass) Method

Creates a map item of a specified type and appends it to the layer’s MapItems collection.

#Declaration

Delphi
function AddItem(AMapItemClass: TdxMapItemClass): TdxMapItem;

#Parameters

Name Type
AMapItemClass TdxMapItemClass

#Returns

Type
TdxMapItem

#Remarks

AMapItemClass specifies the class of map item to be created. Pass any of the built-in map item classes listed in the TdxMapItem class description or a custom one (a TdxMapItem descendant) as this parameter. The created map item is returned as the function’s result.

The following code example shows how to create an item layer, add a pushpin to it using the AddItem method, and specify the pushpin’s label text.

Delphi
uses
   ..., dxMapItemLayer, dxMapItem;
var
  AMapItemLayer: TdxMapItemLayer;
  APushpin: TdxMapPushpin;
begin
  AMapItemLayer := <dxMapControl>.AddItemLayer();
  APushpin := TdxMapPushpin(AMapItemLayer.AddItem(TdxMapPushpin));
  APushpin.Text := 'You are here';
end;
See Also