This is a migrated thread and some comments may be shown as answers.

Prevent Map reposition on InformationLayer Item click

2 Answers 49 Views
Map
This is a migrated thread and some comments may be shown as answers.
Nick
Top achievements
Rank 2
Nick asked on 31 Aug 2010, 06:00 PM
I add visual elements to the InformationLayer with clickable areas and I would like to prevent the RadMap to reposition when clicking on items on that Rad Map.

2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 02 Sep 2010, 08:45 AM
Hi Nick,

You should handle MouseLeftButtonDown event for your clickable areas. For example:

<telerik:RadMap x:Name="radMap" 
    Center="52,0"
    ZoomLevel="6">
    <telerik:RadMap.Provider>
        <telerik:OpenStreetMapProvider />
    </telerik:RadMap.Provider>
    <telerik:InformationLayer x:Name="informationLayer">
        <Grid Width="100" Height="100" 
          telerik:MapLayer.Location="52,0"
          Background="#7F00FFFF"
          MouseLeftButtonDown="GridLeftButtonDown"
          MouseLeftButtonUp="GridLeftButtonUp">
                      
        </Grid>
    </telerik:InformationLayer>
</telerik:RadMap>

private void GridLeftButtonDown(object sender, MouseButtonEventArgs e)
{
    e.Handled = true;
}
  
private void GridLeftButtonUp(object sender, MouseButtonEventArgs e)
{
    // Do something on click.
}


Greetings,
Andrey Murzov
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Nick
Top achievements
Rank 2
answered on 02 Sep 2010, 09:18 AM
Thanks, that does the trick.

All my controls handle their own click events, so I just needed to add e.handled = true, no need for extra code, I just didn't want the clicks to reach the Map itself.
Tags
Map
Asked by
Nick
Top achievements
Rank 2
Answers by
Andrey
Telerik team
Nick
Top achievements
Rank 2
Share this question
or