Category / Section
How to render smart label in Map control?
1 min read
To render smart label in Map control, refer to the following steps.
Step 1
Create a map sample and include necessary script files.
Step 2
Enable “EnableSmartLabel” under LabelSettings in order to view smartlabel.
When you enable this property, the label name that has insufficient space to occupy particular map shape renders near to the available space of map.
ASPX
<LabelSettings ShowLabels = "true" EnableSmartLabel = "true"></LabelSettings>
Code Example
ASPX
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="ControlsSection"> . . . <ej:Map ID="labels" runat="server"> . . . <LabelSettings ShowLabels = "true" EnableSmartLabel = "true"></LabelSettings> . . . </ej:Map> . . . </asp:Content>
ASPX.CS
public partial class Labels : Page { protected void Page_Load(object sender, EventArgs e) { . . . } }
The following screenshot illustrates the output.
Figure 1: Map with smart label
Sample Location