2 Answers, 1 is accepted
0
figueiredorj
Top achievements
Rank 1
answered on 11 May 2011, 10:40 PM
err... I would like to say that I know the answer...
Instead I am going to enhance the question and ask also how to do a custom pushpin.
An example would be nice.
Thanks
Instead I am going to enhance the question and ask also how to do a custom pushpin.
An example would be nice.
Thanks
0
Hi Brian,
The InformationLayer is the ItemsControl. Similar to any other Silverlight items controls it allows to show your business data using custom representation. You can customize presentation of your business data using item templates. For example:
Regards,
Andrey Murzov
the Telerik team
The InformationLayer is the ItemsControl. Similar to any other Silverlight items controls it allows to show your business data using custom representation. You can customize presentation of your business data using item templates. For example:
public class PointOfInterest : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; private Location location; private string title; private string description; private HotSpot hotSpot; private Brush background; private Brush borderBrush; private Thickness borderThickness; public Location Location { get { return this.location; } set { this.location = value; this.NotifyPropertyChanged("Location"); } } public string Title { get { return this.title; } set { this.title = value; this.NotifyPropertyChanged("Title"); } } public string Description { get { return this.description; } set { this.description = value; this.NotifyPropertyChanged("Description"); } } public HotSpot HotSpot { get { return this.hotSpot; } set { this.hotSpot = value; this.NotifyPropertyChanged("HotSpot"); } } public Brush Background { get { return this.background; } set { this.background = value; this.NotifyPropertyChanged("Background"); } } public Brush BorderBrush { get { return this.borderBrush; } set { this.borderBrush = value; this.NotifyPropertyChanged("BorderBrush"); } } public Thickness BorderThickness { get { return this.borderThickness; } set { this.borderThickness = value; this.NotifyPropertyChanged("BorderThickness"); } } protected void NotifyPropertyChanged(string propertyName) { if (this.PropertyChanged != null) { this.PropertyChanged(this, new PropertyChangedEventArgs(propertyName)); } } } <UserControl x:Class="ShowPinPointsCS.MainPage" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" mc:Ignorable="d" d:DesignHeight="300" d:DesignWidth="400"> <UserControl.Resources> <DataTemplate x:Key="CustomTemplate"> <Border telerik:MapLayer.Location="{Binding Location}" telerik:MapLayer.HotSpot="{Binding HotSpot}" Background="{Binding Background}" BorderBrush="{Binding BorderBrush}" BorderThickness="{Binding BorderThickness}"> <Grid Width="50" Height="70" Margin="5"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <TextBlock Grid.Row="0" Text="{Binding Title}" HorizontalAlignment="Center" /> <TextBlock Grid.Row="1" Text="{Binding Description}" HorizontalAlignment="Center" /> </Grid> </Border> </DataTemplate> </UserControl.Resources> <Grid x:Name="LayoutRoot" Background="White"> <telerik:RadMap x:Name="radMap" Center="42, -100" ZoomLevel="8"> <telerik:RadMap.Provider> <telerik:OpenStreetMapProvider /> </telerik:RadMap.Provider> <telerik:InformationLayer x:Name="informationLayer" ItemTemplate="{StaticResource CustomTemplate}" /> </telerik:RadMap> </Grid> </UserControl> Regards,
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