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

MapPinPoint disappears on browser resize

2 Answers 61 Views
Map
This is a migrated thread and some comments may be shown as answers.
Scott Michetti
Top achievements
Rank 1
Scott Michetti asked on 15 Sep 2011, 09:43 PM
Hello. I'm adding a MapPinPoint to the information layer. However, if I resize the browser window, the pinpoint disappears. This was working in the Silverlight 3 version of the RadMap control, but is not working in the Silverlight 4 version. Here's my code. Maybe I need to change my code.

Thanks

public ContentHolder()
        {
            InitializeComponent();
           
            radMap1.UseSpringAnimations = false;
            radMap1.MouseClickMode = MouseBehavior.None;
            radMap1.MouseDoubleClickMode = MouseBehavior.None;
            radMap1.Provider = new OpenStreetMapProvider();
            radMap1.ZoomLevel = 3;        
            AddPoints();
           
        }

        private void AddPoints()
        {
            MapPinPoint pinPoint = new MapPinPoint();
            pinPoint.Cursor = Cursors.Hand;
            pinPoint.ImageSource = new BitmapImage(new Uri(@"/Images/PushPin3.png", UriKind.Relative));          
            MapLayer.SetLocation(pinPoint, new Location(20.00, 1.00));
            MyInformationLayer.Items.Add(pinPoint);
        }

XAML:
<Grid x:Name="LayoutRoot">
        <telerik:RadMap  HorizontalAlignment="Stretch"  Margin="0,0,0,0" Name="radMap1" VerticalAlignment="Stretch">
            <telerik:InformationLayer Height="100" HorizontalAlignment="Left" Margin="298,290,0,0" Name="MyInformationLayer" VerticalAlignment="Top" Width="200" />
        </telerik:RadMap>
    </Grid>

2 Answers, 1 is accepted

Sort by
0
Andrey
Telerik team
answered on 20 Sep 2011, 04:08 PM
Hi Scott Michetti,

You must not use any size/position attributes (like Width/Height, HorizontalAlignment, Margin and so on) in InformationLayer element. It brakes all functionality. Your XAML should look like the following:

<Grid x:Name="LayoutRoot">
   <telerik:RadMap  HorizontalAlignment="Stretch" 
      Margin="0,0,0,0"
      Name="radMap1"
      VerticalAlignment="Stretch">
      <telerik:InformationLayer Name="MyInformationLayer" />
   </telerik:RadMap>
</Grid>


Kind regards,
Andrey Murzov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Scott Michetti
Top achievements
Rank 1
answered on 21 Sep 2011, 04:04 PM
Thanks Andrey. That fixed the problem.
Tags
Map
Asked by
Scott Michetti
Top achievements
Rank 1
Answers by
Andrey
Telerik team
Scott Michetti
Top achievements
Rank 1
Share this question
or