How to use MapPushpin in RadMap

2 posts, 0 answers
  1. Sunil Kumar
    Sunil Kumar avatar
    4 posts
    Member since:
    Oct 2016

    Posted 19 Oct 2016 Link to this post



    I'm trying to display multiple pushpin using RadMap. Below is my code and attached my requirement screenshot. Please advise.


    <telerik:RadMap Grid.Row="0" x:Name="radMap" VerticalAlignment="Stretch" HorizontalAlignment="Stretch"
                                        ZoomLevel="{Binding ZoomLevel, Mode=TwoWay}" Center="{Binding MapCenter, Mode=TwoWay}">
                            <telerik:InformationLayer x:Name="radLocationPins" ItemsSource="{Binding Locations}">
                                        <telerik:MapPinPoint telerik:MapLayer.Location="{Binding MapLocation}" Text="{Binding RowNumber}" Tag="{Binding UnitEvent_ParentEventID}" ImageSource="{Binding ImageSource}">
                                                    <StackPanel x:Name="tmpPushPin" Tag="{Binding UnitEvent_ParentEventID}">
                                                            <i:EventTrigger EventName="MouseLeftButtonUp">
                                                                <ei:ChangePropertyAction TargetObject="{Binding Path=DataContext,ElementName=ReeferMapCW}" PropertyName="SelectedPushPin" Value="{Binding Tag, ElementName=tmpPushPin}" />
                                                                <ei:CallMethodAction TargetObject="{Binding Path=DataContext,ElementName=ReeferMapCW}" MethodName="ChangeSelectedItem"/>
                                                        <!--StackPanel Height="34" Width="20">
                                                                <ImageBrush ImageSource="{Binding ImageSource}"></ImageBrush>
                                                            <TextBlock Height="4"></TextBlock>
                                                            <TextBlock Height="24"  Text="{Binding RowNumber}" Foreground="Black" FontWeight="Bold" FontSize="10" HorizontalAlignment="Center" VerticalAlignment="Center"></TextBlock>

  2. Martin Ivanov
    Martin Ivanov avatar
    1590 posts

    Posted 21 Oct 2016 Link to this post

    Hi Sunhil,

    There are couple reasons why the provided code snippet won't work as expected.
    • The Provider property of the map control is not set. In order to make the map layers to be rendered properly and allow interactions as zooming and panning you will need to define a provider. In case you want to display only the information in the layers you can use EmptyProvider.
          <telerik:EmptyProvider />
    • There is nothing in the custom ControlTemplate of the MapPinPoint element. Make sure that the template defines the element you want to display.
    You can take a look at the attached project.

    Telerik by Progress
    Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Back to Top