Articles in this section
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.

Map with Smart Label

Figure 1: Map with smart label

Sample Location

https://asp.syncfusion.com/demos/web/maps/labels.aspx

Did you find this information helpful?
Yes
No
Help us improve this page
Please provide feedback or comments
Comments (0)
Please sign in to leave a comment
Access denied
Access denied