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

Map pin point

3 Answers 84 Views
Map
This is a migrated thread and some comments may be shown as answers.
prakash
Top achievements
Rank 1
prakash asked on 11 Mar 2011, 11:32 AM
How to place serial number on the pin points on the map to get the direction and start and end point of a route drawn on the map?
how dynamically map pin points color can be changed?

thanks.
Prakash K

3 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 16 Mar 2011, 12:27 PM
Hello prakash,

I'm sorry, but I don't quite understand your question. Could you, please, supply some additional details on the required functionality?

Regards,
Andrey Murzov
the Telerik team
Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
0
prakash
Top achievements
Rank 1
answered on 16 Mar 2011, 12:35 PM
Dear Andrey ,

I mean how can I show following on the push pin on the telerik map

1. title/name/custom text (from data base)
2. different color (based on business fule)
3. icon/images (from database)

I does not mean tool tip.

thanks,
Prakash K
0
Andrey
Telerik team
answered on 18 Mar 2011, 10:33 AM
Hi Prakash,

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"
     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>


Greetings,
Andrey Murzov
the Telerik team
Tags
Map
Asked by
prakash
Top achievements
Rank 1
Answers by
Andrey
Telerik team
prakash
Top achievements
Rank 1
Share this question
or