How to show other property values on map

 n the example code below the countries are displayed correctly. But how can I show my property "Count" as a label on each country? Ideally I'd want Count to display under the country name. How can I accomplish this in code?
<div>
    <SfMaps>
        <MapsLayers>
            <MapsLayer ShapeData='new {dataOptions= "https://cdn.syncfusion.com/maps/map-data/world-map.json"}'
                       ShapePropertyPath='@("name")'
                       DataSource="SecurityCouncilDetails"
                       ShapeDataPath="Name">
                @* color mapping related configuration *@
                <MapsShapeSettings Fill="#E5E5E5" ColorValuePath="Membership">
                    <MapsShapeColorMappings>
                        <MapsShapeColorMapping Value="Permanent" Color="@("#EDB46F")"></MapsShapeColorMapping>
                        <MapsShapeColorMapping Value="Non-Permanent" Color="@("#F1931B")"></MapsShapeColorMapping>
                    </MapsShapeColorMappings>
                </MapsShapeSettings>
                <MapsDataLabelSettings  Visible="true"  />
            </MapsLayer>
        </MapsLayers>
    </SfMaps>
</div>
@code {

    SfMaps Maps;
    MapsLayer Layer1;
   
    public List<UNCouncilCountry> SecurityCouncilDetails = new List<UNCouncilCountry>{
         new UNCouncilCountry { Name= "China", Membership= "Permanent", Count = 3},
         new UNCouncilCountry { Name= "France", Membership= "Permanent", Count = 1},
         new UNCouncilCountry { Name= "Russia", Membership= "Permanent", Count = 6},
         new UNCouncilCountry { Name= "Kazakhstan", Membership= "Non-Permanent", Count = 7},
         new UNCouncilCountry { Name= "Poland", Membership= "Non-Permanent", Count = 2},
         new UNCouncilCountry { Name= "Sweden", Membership= "Non-Permanent", Count = 1},
         new UNCouncilCountry { Name= "United Kingdom", Membership= "Permanent", Count = 5},
         new UNCouncilCountry { Name= "US", Membership= "Permanent", Count = 9},
         new UNCouncilCountry { Name= "Bolivia", Membership= "Non-Permanent", Count = 2},
         new UNCouncilCountry { Name= "Eq. Guinea", Membership= "Non-Permanent", Count = 1},
         new UNCouncilCountry { Name= "Ethiopia", Membership= "Non-Permanent", Count = 1},
         new UNCouncilCountry { Name= "Côte d Ivoire", Membership= "Permanent", Count = 2},
         new UNCouncilCountry { Name= "Kuwait", Membership= "Non-Permanent", Count = 3},
         new UNCouncilCountry { Name= "Netherlands", Membership= "Non-Permanent", Count = 1},
         new UNCouncilCountry { Name= "Peru", Membership= "Non-Permanent", Count = 11}
    };

    public class UNCouncilCountry
    {
        public string Name;
        public string Membership;
        public int Count;
    };
}


6 Replies 1 reply marked as answer

SA Sabari Anand Senthamarai Kannan Syncfusion Team October 9, 2020 08:35 PM UTC

Hi Rick, 
 
Thank you for contacting Syncfusion support. 
 
We can add custom contents in the label of the shapes using LabelTemplate in the Maps component. But we are facing an issue when trying to display the Country name and the Count from the data source. We are currently analyzing this issue. We will update you with further details on October 13, 2020. 
 
Regards, 
Sabari Anand


SB Swetha Babu Syncfusion Team October 13, 2020 03:55 PM UTC

Hi Rick,

Thank you for your patience.
 
  
We are facing an issue in rendering the values from the data source of the marker in the label template in the Maps component. So at present, we cannot render the count value below the country name. However, we have planned to improve the maps component for our 2020 Volume 4 release. We will consider to render the template with the values from the data source in this improvement.

Please let us know if you need any further assistance

Regards,
Swetha Babu
 



SB Swetha Babu Syncfusion Team December 18, 2020 03:00 PM UTC

Hi Rick,

Sorry for the inconvenience caused.

We have not included the fix for the reported issue of "Label Template in maps" in our 2020 Volume 4 Main Release due to some technical issues. However, we will include the fix in our next weekly patch release which is expected to be available at the start of January 2021.

Please let us know if you need any further assistance.

Regards,
Swetha Babu


SB Swetha Babu Syncfusion Team January 6, 2021 04:16 PM UTC

Hi Rick,

Thank you for your update.

We have not included the fix for the reported issue of "Label template in maps" in our weekly patch release. However, we have fixed the reported issue and it is in the testing phase. However, we will include the fix in our next weekly patch release which is expected to be rolled out in the mid of January 2021.

Regards,
Swetha Babu


SB Swetha Babu Syncfusion Team January 19, 2021 03:16 PM UTC

Hi Rick,

Sorry for the inconvenience caused.

We have fixed the reported issue "Label template in maps" but we have not included the fix in our weekly patch release due to some technical difficulties. However, we will include the fix in our 2020 Volume 4 SP1 release which is expected to be rolled out at the end of January 2021.

Regards,
Swetha Babu


SB Swetha Babu Syncfusion Team January 29, 2021 01:06 PM UTC

Hi Rick,

Thank you for your patience.

We have included the fix for the reported issue in our Essential Studio 2020 Volume 4 service pack(v18.4.0.39) and is available for download under the following link.

https://www.syncfusion.com/forums/161973/essential-studio-2020-volume-4-service-pack-release-v18-4-0-39-is-available-for-download

Please find the requested sample from the below link.

https://www.syncfusion.com/downloads/support/forum/158524/ze/MapsLabelTemplate2046964365

In the above sample, we have rendered a world map with a label template using the "LabelTemplate" class in "MapsLayerDataLabelSettings". The count and the continent values are shown in the label template.

We thank you for your support and appreciate your patience in waiting for this release. Please get back to us if you would require further assistance.

Regards,
Swetha Babu

Marked as answer
Loader.
Up arrow icon