Completed
Last Updated: 08 Oct 2019 10:15 by ADMIN
Release R3 2019 SP1

Please refer to the sample project and follow the steps:

1. Run the attached application.
2. Hover over the calendar (custom cluster) 
3. Tooltip is shown.
4. Zoom out once 
5. Hover over the calendar.
6. No tooltip is shown - ToolTipTextNeeded is not called.
7. Zoom out once more.
8. Hover over the calendar.
9. No tooltip is shown - ToolTextNeeded is not called.
10. Zoom out once more. Now two icons are shown.
11. Hover over either calendar. 
12. Tooltip is shown.

Completed
Last Updated: 04 Oct 2019 11:02 by ADMIN
Release R3 2019 SP1

To reproduce:

set the clustering and add some pins upon a button click.

Workaround

Refresh with the following method:

Completed
Last Updated: 15 Aug 2019 15:27 by ADMIN
Release R3 2019 (LIB 2019.2.819)
To reproduce:
1. Add a pin to the map.
radMap1.Layers.Add(new MapLayer("PinLayer"));
MapPin pin = new MapPin(new Telerik.WinControls.UI.Map.PointG(47.60357, -122.32945));
pin.BackColor = Color.Red;
radMap1.Layers[0].Add(pin);
2. Run the project and zoom out.
3. Resize vertically the map(form).

Workaround:
Call Pan method to recalculate RadMapElement.ViewportInPixels on SizeChanged. 
private void RadMap1_SizeChanged(object sender, EventArgs e)
{
    this.radMap1.Pan(this.radMap1.MapElement.PanOffset.Width, this.radMap1.MapElement.PanOffset.Height);
}
Approved
Last Updated: 05 Aug 2019 12:03 by ADMIN
Created by: Ken
Comments: 1
Category: Map
Type: Bug Report
1
Is there a way to not allow the map to WrapAround? 
Completed
Last Updated: 12 Dec 2018 15:04 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Map
Type: Bug Report
0
To reproduce: add a RadMap with a Bing provider, select the canvas "Aerial with labels on demand" and zoom in all the way. It always gets the following exception:

System.ArgumentException: Parameter is not valid.
   at System.Drawing.Image.FromStream(Stream stream, Boolean useEmbeddedColorManagement, Boolean validateImageData)
   at Telerik.WinControls.UI.MapTileDownloader.TileDownloadDataCompleted(Object sender, DownloadDataCompletedEventArgs e)
   at System.Net.WebClient.OnDownloadDataCompleted(DownloadDataCompletedEventArgs e)

The issue is reproducible in Demo application with the Bing examples.

Workaround:

        public RadForm1()
        {
            InitializeComponent();

            string cacheFolder = @"..\..\cache";
            BingRestMapProvider bingProvider = new Telerik.WinControls.UI.BingRestMapProvider();
            bingProvider.TileDownloader = new CustomMapTileDownloader();
            bingProvider.UseSession = true;
            bingProvider.BingKey = "Au8AX-T4JbhfO2rctuV7QaRL4OLIdaDuWi_eboTegWHl_L1U3ZoOgw5VvddfuJAy";
            LocalFileCacheProvider cache = new LocalFileCacheProvider(cacheFolder);
            bingProvider.CacheProvider = cache;
            this.radMap1.Providers.Add(bingProvider);
             
        }

        public class CustomMapTileDownloader : MapTileDownloader
        {
            protected override void TileDownloadDataCompleted(object sender, System.Net.DownloadDataCompletedEventArgs e)
            {
                TileInfo tileInfo = ((TileInfo)e.UserState);

                if (e.Error == null)
                {
                    try
                    {
                        using (MemoryStream ms = new MemoryStream(e.Result))
                        {
                            Image img = Image.FromStream(ms, true, true);
                            tileInfo.Content = e.Result;

                            this.OnTileDownloadComplete(new TileInfoEventArgs(tileInfo));

                            lock (this.webClientsPoolLockObject)
                            {
                                this.webClientsPool[tileInfo.Quadkey].DownloadDataCompleted -= this.TileDownloadDataCompleted;
                                this.webClientsPool.Remove(tileInfo.Quadkey);
                                this.webRequestCache.Remove(tileInfo.Quadkey);
                            }
                        }
                    }
                    catch (Exception)
                    {
                        
                        
                    }
                           
                    
                }
                else
                {
                    if (this.ShouldRetryDownload(e.Error))
                    {
                        Uri uri = this.webRequestCache[tileInfo.Quadkey];

                        lock (this.webClientsPoolLockObject)
                        {
                            uri = new Uri(this.webClientsPool[tileInfo.Quadkey].BaseAddress);
                            this.webClientsPool[tileInfo.Quadkey].DownloadDataCompleted -= this.TileDownloadDataCompleted;
                            this.webClientsPool.Remove(tileInfo.Quadkey);
                            this.webRequestCache.Remove(tileInfo.Quadkey);
                        }

                        this.BeginDownloadTile(uri, tileInfo);
                    }
                }
            }
        }
    }
Approved
Last Updated: 12 Jul 2018 12:50 by ADMIN
How to reproduce: Check the attached project and video

Workaround: force an update in the MapElement
Public Class RadForm1

    Private bingKey As String = ""
    Dim myTimer As Timer
    Public Sub New()

        InitializeComponent()
        Dim bingProvider As BingRestMapProvider = New Telerik.WinControls.UI.BingRestMapProvider()
        bingProvider.UseSession = True
        bingProvider.BingKey = bingKey

        AddHandler bingProvider.SearchCompleted, AddressOf bingProvider_SearchCompleted

        Me.RadMap1.Providers.Add(bingProvider)

        myTimer = New Timer
        myTimer.Interval = 500
        AddHandler myTimer.Tick, AddressOf OnMyyTimerTick
    End Sub

    Private Function OnMyyTimerTick() As Object
        myTimer.Stop()
        Me.RadMap1.MapElement.InvalidateMeasure(True)
    End Function

    Private Sub bingProvider_SearchCompleted(sender As Object, e As SearchCompletedEventArgs)

        myTimer.Start()

    End Sub
End Class
Completed
Last Updated: 15 Mar 2018 15:03 by Dimitar
To reproduce: use the ToolTipTextNeeded event to assign some tool tips for the MapRoutes. You will notice that the tool tips are shown not only when you hover the route line but also around it.
Completed
Last Updated: 15 Mar 2018 14:42 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Map
Type: Bug Report
2
To reproduce:

        public RadForm1()
        {
            InitializeComponent();
            
            this.radMap1.ToolTipTextNeeded += radMap1_ToolTipTextNeeded;

            BingRestMapProvider bingProvider = new Telerik.WinControls.UI.BingRestMapProvider();
            bingProvider.UseSession = true;
            bingProvider.BingKey = bingKey;

            this.radMap1.Providers.Add(bingProvider);

            //add a layer to display the route
            this.radMap1.MapElement.Layers.Add(new MapLayer());

            RouteRequest request = new RouteRequest();
            request.DistanceUnit = DistanceUnit.Kilometer;
            request.Options.Mode = TravelMode.Driving;
            request.Options.Optimization = RouteOptimization.Time;
            request.Options.RouteAttributes = RouteAttributes.RoutePath;
            request.Options.RouteAvoidance = RouteAvoidance.None;
            request.Waypoints.Add("Paris, France");
            request.Waypoints.Add("Madrid, Spain");

            bingProvider.CalculateRouteCompleted += BingProvider_RoutingCompleted;
            bingProvider.CalculateRouteAsync(request);
        }

        private void radMap1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
        {
            Console.WriteLine(sender);
        }

        private void BingProvider_RoutingCompleted(object sender, RoutingCompletedEventArgs e)
        {

            List<PointG> pts = new List<PointG>();
            Telerik.WinControls.UI.Map.PointG startPoint = new Telerik.WinControls.UI.Map.PointG(e.Route.RoutePath.Line.Coordinates.First()[0], e.Route.RoutePath.Line.Coordinates.First()[1]);
            pts.Add(startPoint);
            Telerik.WinControls.UI.Map.PointG endPoint = new Telerik.WinControls.UI.Map.PointG(e.Route.RoutePath.Line.Coordinates.Last()[0], e.Route.RoutePath.Line.Coordinates.Last()[1]);
            pts.Add(endPoint); 
            MapPolyline mapPolyline = new MapPolyline(pts);
            mapPolyline.BackColor = Color.Red;
            mapPolyline.BorderColor = Color.Red;
            mapPolyline.BorderWidth = 5;
            this.radMap1.MapElement.Layers[0].Add(mapPolyline);

            PointG midPoint = new PointG((startPoint.Latitude + endPoint.Latitude) / 2d, (startPoint.Longitude + endPoint.Longitude) / 2d);
            MapLabel westernLabel = new MapLabel(midPoint, "My label")
            {
                BackColor = Color.FromArgb(122, 255, 0, 0)
            };
            this.radMap1.MapElement.Layers[0].Add(westernLabel);
        }

Workaround:

        public class CustomMapPolyline : MapPolyline
        {
            List<GraphicsPath> paths;

            public CustomMapPolyline(IEnumerable<PointG> points) : base(points)
            {
            }

            public override void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
            {
                base.ViewportChanged(viewport, action);

                FieldInfo fi = typeof(MapPolyline).GetField("paths", BindingFlags.Instance | BindingFlags.NonPublic);
                this.paths = (List<GraphicsPath>)fi.GetValue(this);
            }

                     public override bool HitTest(PointG pointG, PointL pointL, IMapViewport viewport)
            {
                using (Pen pen = new Pen(this.BorderColor, this.BorderWidth))
                {
                    foreach (GraphicsPath path in this.paths)
                    {
                        if (path.IsOutlineVisible(pointL.X, pointL.Y, pen))
                        {
                            return true;
                        }
                    }
                }

                return false;
            }
        }
Approved
Last Updated: 28 Feb 2018 14:16 by ADMIN
To reproduce:
- Create a shape with QGIS and add it to RadMap using the approach described in the documentation: http://docs.telerik.com/devtools/winforms/map/file-readers/esri-shapefile-reader
Completed
Last Updated: 22 Feb 2018 12:36 by Dimitar
Workaround:
Public Class MyLocalMapProvider
    Inherits LocalMapProvider

    Public Overrides Sub ViewportChanged(viewport As IMapViewport, action As ViewportChangeAction)
        If Not Me.Initialized Then
            Me.Initialize()

            Return
        End If

        Dim tilesToDraw As List(Of MapVisualElement) = DirectCast(Me.GetType().BaseType.GetField("tilesToDraw", BindingFlags.Instance Or BindingFlags.NonPublic).GetValue(Me), List(Of MapVisualElement))

        Dim numOfTilesX As Integer = CInt(Math.Ceiling(CDbl((viewport.ViewportInPixels.Width)) / Me.TileSize.Width)) + 2
        Dim numOfTilesY As Integer = CInt(Math.Ceiling(CDbl((viewport.ViewportInPixels.Height)) / Me.TileSize.Height)) + 2
        Dim maxNumberOfTilesY As Integer = If((viewport.ZoomLevel = 1), 2, (viewport.ZoomLevel - 1) << 2)
        numOfTilesY = Math.Min(numOfTilesY, maxNumberOfTilesY)

        Dim topLeftTile As Point = MapTileSystemHelper.PixelXYToTileXY(-viewport.PanOffset.Width, -viewport.PanOffset.Height)

        Dim numberOfTiles As Integer = 2 << (viewport.ZoomLevel - 1)
        Dim startX As Integer = CInt(viewport.PanOffset.Width) Mod Me.TileSize.Width
        Dim startY As Integer = CInt(viewport.PanOffset.Height) Mod Me.TileSize.Height

        If startX > 0 Then
            startX -= Me.TileSize.Width
        End If

        For i As Integer = 0 To numOfTilesY - 1
            For j As Integer = 0 To numOfTilesX - 1
                Dim x As Integer = startX + j * Me.TileSize.Width
                Dim y As Integer = startY + i * Me.TileSize.Height

                Dim tileX As Integer = (topLeftTile.X + j) Mod numberOfTiles
                Dim tileY As Integer = (topLeftTile.Y + i) Mod numberOfTiles

                If tileX < 0 Then
                    tileX += numberOfTiles
                End If

                tilesToDraw.Add(New MapTile(Me.GetTileImage(tileX, tileY, viewport.ZoomLevel), New Rectangle(New Point(x, y), Me.TileSize)))
            Next
        Next
    End Sub
End Class
Completed
Last Updated: 05 Feb 2018 10:53 by Dimitar
How to reproduce: Change the current culture so that a comma is used as a decimal separator, the Elevations example will fail with a (400) Bar Request error.

Workaround: create a custom BingRestMapProvider class
public class CustomBingRestMapProvider : BingRestMapProvider
    {
        protected override string GetPointsString(List<PointG> points)
        {
            StringBuilder sb = new StringBuilder();

            for (int i = 0; i < points.Count; i++)
            {
                PointG point = points[i];

                if (i > 0)
                {
                    sb.Append(",");
                }

                sb.Append(point.Latitude.ToString(CultureInfo.InvariantCulture) + "," + point.Longitude.ToString(CultureInfo.InvariantCulture));
            }

            return sb.ToString();
        }
    }
Completed
Last Updated: 22 Dec 2017 10:34 by ADMIN
To reproduce:
- Use a DataTable as a data source for SqlGeospatialDataReader.
- An exception will occur.

Workaround:
Convert the data table to a simple list of custom objects.
Approved
Last Updated: 20 Nov 2017 15:52 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Map
Type: Bug Report
1

			
Approved
Last Updated: 20 Nov 2017 15:42 by ADMIN
Error:

System.ArgumentException was unhandled
  HResult=-2147024809
  Message=An item with the same key has already been added.
  Source=mscorlib
  StackTrace:
       at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
       at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
       at Telerik.WinControls.UI.DbfHeader.CreateExtendedPropertySet()
       at Telerik.WinControls.UI.DbfReader..ctor(Stream stream, ExtendedPropertySet propertySet, Encoding encoding)
       at Telerik.WinControls.UI.ShapeFileReader.Read(ShapeFileReaderParameters parameters)
       at _1125357MapShapeFiles.RadForm1..ctor() in d:\Projects\1125357MapShapeFiles\RadForm1.cs:line 37
       at _1125357MapShapeFiles.Program.Main() in d:\Projects\1125357MapShapeFiles\Program.cs:line 17
       at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: 
Completed
Last Updated: 30 Oct 2017 06:33 by ADMIN
How to reproduce:  
public partial class Form3 : Form
 {
     public Form3()
     {
         InitializeComponent();

         MapLayer pointLayer = new MapLayer("PointG");
         pointLayer.ClusterStrategy = new ElementClusterStrategy();
         pointLayer.ClusterDistance = 100;
         this.radMap1.Layers.Add(pointLayer);

         MapPin pin1 = new MapPin(new PointG(45d, 15d)) { BackColor = Color.Coral, ToolTipText = "Tool Tip1" };
         MapPin pin2 = new MapPin(new PointG(44d, 18d)) { BackColor = Color.Coral, ToolTipText = "Tool Tip2" };
         this.radMap1.Layers["PointG"].Add(pin1);
         this.radMap1.Layers["PointG"].Add(pin2);

         this.SetupProviders();
     }

     private void radMap1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
     {
         MapCluster cluster = sender as MapCluster;
         if (cluster != null && cluster.ClusteredItems.Count == 1)
         {
             cluster.ToolTipText = ((MapPin)cluster.ClusteredItems[0]).ToolTipText;
         }
     }

     private void SetupProviders()
     {
         string cacheFolder = @"..\..\cache";
         BingRestMapProvider bingProvider = new BingRestMapProvider();
         bingProvider.Culture = System.Threading.Thread.CurrentThread.CurrentCulture;
         bingProvider.ImagerySet = ImagerySet.Road;
         bingProvider.UseSession = true;
         bingProvider.BingKey = "...";

         LocalFileCacheProvider cache = new LocalFileCacheProvider(cacheFolder);
         bingProvider.CacheProvider = cache;

         this.radMap1.MapElement.Providers.Add(bingProvider);

         bingProvider.InitializationComplete += bingProvider_InitializationComplete;
     }

     private void bingProvider_InitializationComplete(object sender, EventArgs e)
     {
         this.radMap1.BringIntoView(new PointG(45d, 15d), 5);
     }

 }

Workaround: handle the ToolTipNeededEvent
 private void radMap1_ToolTipTextNeeded(object sender, Telerik.WinControls.ToolTipTextNeededEventArgs e)
 {
     MapCluster cluster = sender as MapCluster;
     if (cluster != null && cluster.ClusteredItems.Count == 1)
     {
         cluster.ToolTipText = ((MapPin)cluster.ClusteredItems[0]).ToolTipText;
     }
 }
Completed
Last Updated: 25 Aug 2017 11:20 by ADMIN
You can find attached a sample project, video, demonstrating the steps and a screenshot of the error.

Workaround:

public class MyMapVisualElementFactory : MapVisualElementFactory
{
    public override MapVisualElement CreatePolyline(Collection<PointG> points)
    {
        return new MyMapPolyline(points);
    }
}

public class MyMapPolyline : MapPolyline
{
    private FieldInfo pathsField;
    private FieldInfo boundingRectsField;
    private FieldInfo isInViewportField;

    public MyMapPolyline(Collection<PointG> points) : base(points)
    {
        this.pathsField = typeof(MapPolyline).GetField("paths", BindingFlags.Instance | BindingFlags.NonPublic);
        this.boundingRectsField = typeof(MapPolyline).GetField("boundingRects", BindingFlags.Instance | BindingFlags.NonPublic);
        this.isInViewportField = typeof(MapPolyline).GetField("isInViewport", BindingFlags.Instance | BindingFlags.NonPublic);
    }

    public override void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
    {
        if ((action & ViewportChangeAction.All) == action) 
        {
            long mapSize = MapTileSystemHelper.MapSize(viewport.ZoomLevel);
            List<GraphicsPath> paths = new List<GraphicsPath>();
            List<RectangleL> boundingRects = new List<RectangleL>();

            long start = viewport.PanOffset.Width;
            int maxWraparounds = 1;

            while (start + mapSize < viewport.ViewportInPixels.Width)
            {
                maxWraparounds++;
                start += mapSize;
            }

            for (int i = -1; i <= maxWraparounds; i++)
            {
                GraphicsPath path = new GraphicsPath();

                List<PointF> drawPoints = new List<PointF>();

                foreach (PointG p in this.Points)
                {
                    PointL pixel = MapTileSystemHelper.LatLongToPixelXY(p.Latitude, p.Longitude, viewport.ZoomLevel);
                    drawPoints.Add(new PointF(pixel.X + i * mapSize, pixel.Y));
                }

                path.AddLines(drawPoints.ToArray());

                RectangleF rect = path.GetBounds();
                RectangleF view = new RectangleF(viewport.ViewportInPixels.X, viewport.ViewportInPixels.Y, 
                    viewport.ViewportInPixels.Width, viewport.ViewportInPixels.Height);

                if (rect.IntersectsWith(view))
                {
                    paths.Add(path);
                }

                boundingRects.Add(new RectangleL((long)rect.X, (long)rect.Y, (long)rect.Width, (long)rect.Height)); 
            }

            this.pathsField.SetValue(this, paths);
            this.boundingRectsField.SetValue(this, boundingRects);
        }

        if (action != ViewportChangeAction.None)
        {
            this.isInViewportField.SetValue(this, false);
            List<RectangleL> boundingRects = this.boundingRectsField.GetValue(this) as List<RectangleL>;

            foreach (RectangleL rect in boundingRects)
            {
                if (viewport.ViewportInPixels.IntersectsWith(rect))
                {
                    this.isInViewportField.SetValue(this, true);
                }
            }
        }
    }
}

public class MyMapVisualElementFactory : MapVisualElementFactory
{
    public override MapVisualElement CreatePolyline(Collection<PointG> points)
    {
        return new MyMapPolyline(points);
    }
}

public class MyMapPolyline : MapPolyline
{
    private FieldInfo pathsField;
    private FieldInfo boundingRectsField;
    private FieldInfo isInViewportField;

    public MyMapPolyline(Collection<PointG> points) : base(points)
    {
        this.pathsField = typeof(MapPolyline).GetField("paths", BindingFlags.Instance | BindingFlags.NonPublic);
        this.boundingRectsField = typeof(MapPolyline).GetField("boundingRects", BindingFlags.Instance | BindingFlags.NonPublic);
        this.isInViewportField = typeof(MapPolyline).GetField("isInViewport", BindingFlags.Instance | BindingFlags.NonPublic);
    }

    public override void ViewportChanged(IMapViewport viewport, ViewportChangeAction action)
    {
        if ((action & ViewportChangeAction.All) == action) 
        {
            long mapSize = MapTileSystemHelper.MapSize(viewport.ZoomLevel);
            List<GraphicsPath> paths = new List<GraphicsPath>();
            List<RectangleL> boundingRects = new List<RectangleL>();

            long start = viewport.PanOffset.Width;
            int maxWraparounds = 1;

            while (start + mapSize < viewport.ViewportInPixels.Width)
            {
                maxWraparounds++;
                start += mapSize;
            }

            for (int i = -1; i <= maxWraparounds; i++)
            {
                GraphicsPath path = new GraphicsPath();

                List<PointF> drawPoints = new List<PointF>();

                foreach (PointG p in this.Points)
                {
                    PointL pixel = MapTileSystemHelper.LatLongToPixelXY(p.Latitude, p.Longitude, viewport.ZoomLevel);
                    drawPoints.Add(new PointF(pixel.X + i * mapSize, pixel.Y));
                }

                path.AddLines(drawPoints.ToArray());

                RectangleF rect = path.GetBounds();
                RectangleF view = new RectangleF(viewport.ViewportInPixels.X, viewport.ViewportInPixels.Y, 
                    viewport.ViewportInPixels.Width, viewport.ViewportInPixels.Height);

                if (rect.IntersectsWith(view))
                {
                    paths.Add(path);
                }

                boundingRects.Add(new RectangleL((long)rect.X, (long)rect.Y, (long)rect.Width, (long)rect.Height)); 
            }

            this.pathsField.SetValue(this, paths);
            this.boundingRectsField.SetValue(this, boundingRects);
        }

        if (action != ViewportChangeAction.None)
        {
            this.isInViewportField.SetValue(this, false);
            List<RectangleL> boundingRects = this.boundingRectsField.GetValue(this) as List<RectangleL>;

            foreach (RectangleL rect in boundingRects)
            {
                if (viewport.ViewportInPixels.IntersectsWith(rect))
                {
                    this.isInViewportField.SetValue(this, true);
                }
            }
        }
    }
}
Completed
Last Updated: 15 Aug 2017 10:20 by ADMIN
How to reproduce: change the Windows culture to Greek and start the OSM example
Completed
Last Updated: 15 Feb 2017 13:24 by ADMIN
How to reproduce: check the attached video

Workaround: create a custom MapSearchBarElement
public class MyRadMap : RadMap
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadMap).FullName;
        }
    }
 
    protected override RadMapElement CreateMapElement()
    {
        return new MyRadMapElement();
    }
}
 
public class MyRadMapElement :  RadMapElement
{
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(RadMapElement);
        }
    }
 
    protected override MapSearchBarElement CreateSearchBarElement()
    {
 
        return new MyMapSearchBarElement(this);
    }
}
 
public class MyMapSearchBarElement : MapSearchBarElement
{
    public MyMapSearchBarElement(MyRadMapElement mapElement)
        : base(mapElement)
    { }
 
    protected override Type ThemeEffectiveType
    {
        get
        {
            return typeof(MapSearchBarElement);
        }
    }
 
    protected override void SearchProviderSearchError(object sender, SearchErrorEventArgs e)
    {
        IMapSearchProvider provider = sender as IMapSearchProvider;
        provider.SearchCompleted -= SearchProviderSearchCompleted;
        provider.SearchError -= SearchProviderSearchError;
 
        if (this.ElementTree != null)
        {
            UnsubscribeToTextBoxEvents(this.SearchTextBoxElement);
            RadMessageBox.SetThemeName(this.ElementTree.ThemeName);
            RadMessageBox.Show(e.Error.Message);
            SubscribeToTextBoxEvents(this.SearchTextBoxElement);
        }
    }
 
    protected override void SubscribeToTextBoxEvents(RadTextBoxElement textBox)
    {
        textBox.TextChanged += OnSearchTextBoxTextChanged;
        textBox.KeyDown += OnSearchTextBoxKeyDown;
    }
 
    protected override void UnsubscribeToTextBoxEvents(RadTextBoxElement textBox)
    {
        textBox.TextChanged -= OnSearchTextBoxTextChanged;
        textBox.KeyDown -= OnSearchTextBoxKeyDown;
    }
 
    private void OnSearchTextBoxKeyDown(object sender, System.Windows.Forms.KeyEventArgs e)
    {
        if (e.KeyCode == Keys.Enter)
        {
            this.Search(this.SearchTextBoxElement.Text);
        }
    }
}
Completed
Last Updated: 04 Jan 2017 15:02 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Sr.
Comments: 0
Category: Map
Type: Bug Report
1
1. Open the demo application >> Map >> Search example.
2. Enter some text and press Enter.
3. Move the mouse a little bit and you will notice the search box looses focus.

Workaround:  this.radMap1.MapElement.SearchBarElement.SearchTextBoxElement.TextBoxItem.LostFocus+=TextBoxItem_LostFocus;

        private void TextBoxItem_LostFocus(object sender, EventArgs e)
        {
            this.radMap1.MapElement.SearchBarElement.SearchTextBoxElement.TextBoxItem.TextBoxControl.Focus();
        }
1 2