)
We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to customize the markers in maps

Platform: WPF |
Control: SfMaps |
Published Date: April 7, 2017 |
Last Revised Date: June 26, 2019

Map Markers can be customized by using the following steps,

Step1: Create a Maps sample,and include the necessary script files.

Step2: The default appearance of the marker can be customized by using the MarkerTemplate property. The Marker template property is available in the ShapeFileLayer.

XAML

<syncfusion:ShapeFileLayer.MarkerTemplate>
    <DataTemplate>
     <Grid Margin="-12,-30,0,0">
          <Canvas>
          <Image Source="pin.png" Height="30"/> </Canvas>
          <Grid DataContext="{Binding Data}" Width="265">
          <Grid.RowDefinitions>
                 <RowDefinition /> 
           </Grid.RowDefinitions>
           <Grid.ColumnDefinitions>
                 <ColumnDefinition/>
           </Grid.ColumnDefinitions>
      <Canvas Grid.Row="0" Grid.Column="0" Margin="0,0,106,0" >
     <Image Source="mappath.png" Width="92" Canvas.Top="25" Canvas.Left="10"/>
 <TextBlock Foreground="White" HorizontalAlignment="Center" FontSize="15" FontFamily="Segoe UI" Text="{Binding Name}" Canvas.Left="25" Canvas.Top="25" RenderTransformOrigin="0.515,-0.3"/>
      </Canvas>
 </Grid>
</Grid>
</DataTemplate>
</syncfusion:ShapeFileLayer.MarkerTemplate>

The following screenshot shows the customization of Map Markers using Marker Template.

Output Image:

Marker customization in SfMaps control

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon