PushPin selectable area

1 Answer 24 Views
Map
hhgm
Top achievements
Rank 1
Iron
Iron
Iron
hhgm asked on 14 Feb 2025, 09:22 PM

Hi,

I am working on a tool for an application based on one of the examples. I have noticed that when I create the pushpin using a Path then it is only selected if I hit exactly on the lines of the image being drawn.

This could be a general XAML question, but not really sure how this works. I would like to have the pin selected when I hit the area defined by the image.

My datatemplate:

            <DataTemplate x:Key="PositionPushPinTemplate">
                <Grid telerik:MapLayer.Location="{Binding Location}"
                      telerik:RadToolTipService.PlacementRectangle="-38 0 0 0"
                      telerik:RadToolTipService.Placement="Top"
                      telerik:RadToolTipService.ToolTipContent="{Binding}"
                      telerik:RadToolTipService.ToolTipContentTemplate="{StaticResource LocationLabelTemplate}"
                      HorizontalAlignment="Center"
                      VerticalAlignment="Top">
                    <Path Canvas.Top="2.989" Canvas.Left="3.188" 
                          Data="{Binding Icon}" 
                          Stretch="Uniform" 
                          Fill="{Binding Color}" 
                          Width="26" 
                          Height="26" 
                          Margin="0,0,0,0" 
                          RenderTransformOrigin="0.5,0.5">
                        <Path.RenderTransform>
                            <TransformGroup>
                                <TransformGroup.Children>
                                    <RotateTransform Angle="0" />
                                    <ScaleTransform ScaleX="1" ScaleY="1" />
                                </TransformGroup.Children>
                            </TransformGroup>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
            </DataTemplate>

1 Answer, 1 is accepted

Sort by
0
hhgm
Top achievements
Rank 1
Iron
Iron
Iron
answered on 21 Feb 2025, 11:19 PM
The answer is preseneted her: https://stackoverflow.com/questions/2168970/wpf-making-the-entire-block-of-a-path-clickable
Tags
Map
Asked by
hhgm
Top achievements
Rank 1
Iron
Iron
Iron
Answers by
hhgm
Top achievements
Rank 1
Iron
Iron
Iron
Share this question
or