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

Telerik Map - Information Layer issue

2 Answers 68 Views
Map
This is a migrated thread and some comments may be shown as answers.
Sunil
Top achievements
Rank 1
Sunil asked on 27 Oct 2016, 09:16 AM

Hi,

 

I have created dynamic InformationLayer to display the user control. But I'm facing margin issue. Please check the screenshot  with and without margin.

        private Telerik.Windows.Controls.Map.InformationLayer calloutLayer;
        public ReeferMapControl()
        {
            this.Language = XmlLanguage.GetLanguage(Thread.CurrentThread.CurrentCulture.Name);
            calloutLayer = new Telerik.Windows.Controls.Map.InformationLayer();
            this.RfrMap.Items.Add(calloutLayer);
        }

       void ViewModel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
        {

                    BalloonCalloutUserControl callout = null;

                    currentLocation = new Telerik.Windows.Controls.Map.Location(CurrentLocation.GPSLatitude.Value, CurrentLocation.GPSLongitude.Value);
                    callout = new BalloonCalloutUserControl(CurrentLocation);

                    calloutLayer.Margin = new Thickness(-36, 0, 0, 0); //Images related to margin

                    Telerik.Windows.Controls.Map.MapLayer.SetLocation(callout, currentLocation);
                    this.calloutLayer.Items.Add(callout);
                    this.RfrMap.Center = currentLocation;
                    this.RfrMap.ZoomLevel = vm.ZoomLevel;

        }

Thanks,

Sunil Kumar.

2 Answers, 1 is accepted

Sort by
0
Sunil
Top achievements
Rank 1
answered on 27 Oct 2016, 09:19 AM
Forgot the attachements...
0
Martin Ivanov
Telerik team
answered on 31 Oct 2016, 04:31 PM
Hello Sunil,

I checked your code and the images, but without your implementation and locations I can't tell why the balloon is not displayed. In any case displacing the layer is not a good idea, because the plotted locations will no longer be correct. Instead, I recommend you to make sure that the proper locations are passed to the elements added in the layer. Note that the balloon UserControl will start drawing from its location. In other words its top left corner will correspond to its location.

Regards,
Martin
Telerik by Progress
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
Map
Asked by
Sunil
Top achievements
Rank 1
Answers by
Sunil
Top achievements
Rank 1
Martin Ivanov
Telerik team
Share this question
or