Telerik Map - Information Layer issue

3 posts, 0 answers
  1. Sunil
    Sunil avatar
    3 posts
    Member since:
    Oct 2016

    Posted 27 Oct 2016 Link to this post

    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. Sunil
    Sunil avatar
    3 posts
    Member since:
    Oct 2016

    Posted 27 Oct 2016 in reply to Sunil Link to this post

    Forgot the attachements...
  3. Martin
    Admin
    Martin avatar
    1199 posts

    Posted 31 Oct 2016 Link to this post

    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.
Back to Top