Completed
Last Updated: 23 Apr 2020 16:12 by ADMIN
Release R2 2020 (LIB 2020.1.423)

Hello,

I am using RadMap to display a KML file.

Unfortunately, it looks like RadMap is not displaying properly all the shapes (departments).

Displayed with RadMap (few holes, ie departments not displayed): 

 

Displayed with a third party tool (all departments properly displayed):

I have attached the KML file in a zip file.

 Best,

Olivier 

Unplanned
Last Updated: 04 Mar 2020 15:28 by ADMIN
Add a MapPath object to a layer of RadMap and zoom in to the last possible level. 
An exception is thrown.
public partial class RadForm1 : RadForm
{
    private BingRestMapProvider bingProvider;

    public RadForm1()
    {
        this.InitializeComponent();
        this.SetupBingProvider();
        this.SetupLayers();

        this.ImportTestItem();
        this.radMapViewer.MapElement.MiniMapElement.EnableZooming = true;
    }

    private void SetupBingProvider()
    {
        string bingKey = "Your Bing Key";

        this.bingProvider = new BingRestMapProvider();
        this.bingProvider.UseSession = true;
        this.bingProvider.BingKey = bingKey;
        this.bingProvider.ImagerySet = Telerik.WinControls.UI.Map.Bing.ImagerySet.Aerial;
        LocalFileCacheProvider cache = new LocalFileCacheProvider(@"..\..\cache");
        this.bingProvider.CacheProvider = cache;
        this.bingProvider.ProviderUpdated += this.BingProvider_ProviderUpdated;
        this.radMapViewer.Providers.Add(this.bingProvider);

        this.bingProvider.InitializationComplete += this.BingProvider_InitializationComplete;
    }

    private void BingProvider_ProviderUpdated(object sender, EventArgs e)
    {
        // Workaround
        this.bingProvider.MaxZoomLevel = 20;
    }

    private void BingProvider_InitializationComplete(object sender, EventArgs e)
    {
        this.radMapViewer.BringIntoView(new PointG(42.698559196991135, 23.320803862212352), 20);
    }

    private void SetupLayers()
    {
        MapLayer modelLayer = new MapLayer("Models");
        this.radMapViewer.Layers.Add(modelLayer);
    }

    public void ImportTestItem()
    {
        Collection<Collection<PointG>> paths = new Collection<Collection<PointG>>();
        var points = new Collection<PointG>();
        paths.Add(points);
        points.Add(new PointG(42.698559196991135, 23.320803862212352));
        points.Add(new PointG(42.698927962901238, 23.319237221916447));
        points.Add(new PointG(42.698928093965123, 23.319236667248555));
        points.Add(new PointG(42.698928095639218, 23.319236660952237));
        points.Add(new PointG(42.698661960692946, 23.319152714625682));
        points.Add(new PointG(42.698661958997257, 23.319152719880927));
        points.Add(new PointG(42.698661126454983, 23.319156258531189));
        points.Add(new PointG(42.698366706433447, 23.320407248233786));
        points.Add(new PointG(42.698559196991135, 23.320803862212352));

        MapPath mapVisual = new MapPath(paths);
        mapVisual.BorderColor = Color.Blue;
        mapVisual.BackColor = Color.Empty;
        mapVisual.BorderWidth = 3;

        this.radMapViewer.Layers["Models"].Add(mapVisual);
    }
}
Completed
Last Updated: 09 Jan 2020 16:06 by ADMIN
Release R1 2020

Recently OpenStreetMap changed their tile usage policy and require UserAgent string in the web headers for accessing tile.openstreetmap.org tiles.

https://operations.osmfoundation.org/policies/tiles/

As a result, standard open street map mode does not work - no tiles are loaded and "too many requests" error is returned from the server.

RadMap's OpenStreetMapProvider needs API (event, property or similar) for easier set up of UserAgent / Referer / other headers of web requests.

 

Unplanned
Last Updated: 08 Sep 2021 04:48 by ADMIN
Created by: Serena
Comments: 5
Category: Map
Type: Feature Request
8

Hi
We would like to use vector tiles in our offline mapping applications, like ones you can get here :- https://openmaptiles.com/downloads/dataset/osm/europe/great-britain/england/#5.03/52.946/-2.426

I think telerik only supports raster files right now.  Is there any plans to support vector files in the future?  Could it be added to the roadmap?

(I am not looking for a way to convert vector files into PNG/Bitmap/JPEG Image tiles in a custom provider thanks)

Completed
Last Updated: 28 Nov 2019 14:06 by ADMIN
Release R1 2020
Created by: Tim
Comments: 0
Category: Map
Type: Feature Request
0
Completed
Last Updated: 28 Nov 2019 14:05 by ADMIN
Release R1 2020
Created by: Tim
Comments: 0
Category: Map
Type: Feature Request
0

I have noticed in the routing there is no maxSolutions parameter available when querying the bing map api routing parameter.   

https://docs.microsoft.com/en-us/bingmaps/rest-services/routes/calculate-a-route 

Unplanned
Last Updated: 08 Oct 2019 08:47 by ADMIN
Created by: TRANSEPT
Comments: 1
Category: Map
Type: Feature Request
1

Hi Team,

Are there any intermediate zoomlevel in the RadMap object?

Currently the transition from one zoomlevel to another is too important.

Thank you for your response

Unplanned
Last Updated: 16 Sep 2019 10:33 by ADMIN
Created by: Carlos
Comments: 1
Category: Map
Type: Feature Request
1
Please add the capability to visualize data in the format seen in the attachment.
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: 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);
}
Unplanned
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? 
Unplanned
Last Updated: 18 Jun 2019 14:08 by ADMIN
Created by: Robin
Comments: 1
Category: Map
Type: Feature Request
0

I am wanting to load an image and polygon onto the Map control. I am using a KML file. I am able to load the polygon but NOT able to display the image in the map control.

i.e. if I open the KML file in google earth the image and polygon are displayed, I want to 'replicate' this in the Map control.

 

Below is my sample code and attached are the KML file and image files.

 

Dim osmProvider As New OpenStreetMapProvider()

        Me.RadMap1.MapElement.Providers.Add(osmProvider)

 

        Me.RadMap1.Layers.Clear()

        Me.RadMap1.Layers.Add(New MapLayer("Pens"))

        Using seatsStream As New FileStream("D:\MyTelerikMap\Farm.kml", FileMode.Open, FileAccess.Read)

            Dim elements As List(Of MapVisualElement) = KmlReader.Read(seatsStream)

            For Each item As MapVisualElement In elements

                item.BorderWidth = 1

                item.BorderColor = Color.Black

                item.BackColor = Color.Red

            Next

            Me.RadMap1.Layers("Pens").AddRange(elements)

        End Using

 

        Dim MyCenter As PointG

        MyCenter.Latitude = -16.545276685809551

        MyCenter.Longitude = 28.87446081916244

 

        RadMap1.MapElement.BringIntoView(MyCenter, 16)

 

Thank you in advanced for your assistance.

 

 

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: 22 Jan 2020 11:12 by ADMIN
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 2
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 = "your bing key";
            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);
                    }
                }
            }
        }
    }
Unplanned
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: 14 Jun 2018 14:44 by Dimitar
ADMIN
Created by: Dess | Tech Support Engineer, Principal
Comments: 0
Category: Map
Type: Feature Request
1
To reproduce: The TileSize property of the LocalMapProvider is readonly.

Workaround:

 public class CustomLocalMapProvider : LocalMapProvider
        {
           
            public CustomLocalMapProvider()
            {
              
                FieldInfo fi = typeof(LocalMapProvider).GetField("tileSize", BindingFlags.Instance | BindingFlags.NonPublic);
                fi.SetValue(this, new Size(200,200));
            }
        }
Unplanned
Last Updated: 21 Jun 2018 13:55 by ADMIN
ADMIN
Created by: Dimitar
Comments: 0
Category: Map
Type: Feature Request
2
In WPF this is possible with custom provider: https://www.telerik.com/forums/map-control-and-web-map-service
Completed
Last Updated: 10 Apr 2018 13:44 by Dimitar
How to reproduce: check the attached project, the expected behavior would be that the MapPoint object have its text painted
Workaround:
public partial class RadForm1 : Telerik.WinControls.UI.RadForm
{
    public RadForm1()
    {
        InitializeComponent();

        MapLayer pinsLayer = new MapLayer("Buildings Layout");
        this.radMap1.Layers.Add(pinsLayer);
        EmptyMapProvider emptyProvider = new EmptyMapProvider();
        emptyProvider.InitializationComplete += emptyProvider_InitializationComplete;

        this.radMap1.Providers.Add(emptyProvider);
        using (FileStream seatsStream = File.OpenRead(@"..\..\shapes-new\Label_Pk_Boulou2.shp"))
        {
            using (FileStream seatsDataStream = File.OpenRead(@"..\..\shapes-new\Label_Pk_Boulou2.dbf"))
            {
                ShapeFileReaderParameters parameters = new ShapeFileReaderParameters();
                parameters.ShapeStream = seatsStream;
                parameters.DbfStream = seatsDataStream;
                //parameters.CoordinateConverter = new EPSG900913Converter();
                ShapeFileReader reader = new ShapeFileReader();
                List<MapVisualElement> elements = reader.Read(parameters);
                foreach (var item in elements)
                {
                    item.Text = Convert.ToString(((IExtendedData)item).ExtendedData["Text"]);
                }

                this.radMap1.Layers["Buildings Layout"].AddRange(elements);

            }
        }
    }
}

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, Principal
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;
            }
        }