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)

Unplanned
Last Updated: 03 Oct 2024 12:49 by Scott
Created by: Francois
Comments: 5
Category: Map
Type: Feature Request
3
 
Completed
Last Updated: 05 Dec 2016 14:03 by ADMIN
In the scenario below one should be able to access the defined UserData value in the SearchCompleted event handler

How to reproduce:
protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);

            this.radMap1.ShowSearchBar = true;
            BingRestMapProvider bingProvider = this.radMap1.Providers[0] as BingRestMapProvider;
            this.radMap1.MapElement.SearchBarElement.SearchProvider = bingProvider;

            this.radMap1.MapElement.SearchBarElement.SearchProvider.SearchCompleted += BingProvider_SearchCompleted;
        }

        private void BingProvider_SearchCompleted(object sender, SearchCompletedEventArgs e)
        {
            Telerik.WinControls.UI.Map.RectangleG allPoints = new Telerik.WinControls.UI.Map.RectangleG(double.MinValue, double.MaxValue, double.MaxValue, double.MinValue);
            this.radMap1.Layers["Pins"].Clear();
            foreach (Telerik.WinControls.UI.Map.Bing.Location location in e.Locations)
            {
                Telerik.WinControls.UI.Map.PointG point = new Telerik.WinControls.UI.Map.PointG(location.Point.Coordinates[0], location.Point.Coordinates[1]);
                MapPin pin = new MapPin(point);
                pin.Size = new System.Drawing.Size(20, 40);
                pin.BackColor = Color.Red;
                pin.ToolTipText = location.Address.FormattedAddress;
                this.radMap1.MapElement.Layers["Pins"].Add(pin);
                allPoints.North = Math.Max(allPoints.North, point.Latitude);
                allPoints.South = Math.Min(allPoints.South, point.Latitude);
                allPoints.West = Math.Min(allPoints.West, point.Longitude);
                allPoints.East = Math.Max(allPoints.East, point.Longitude);
            }
            if (e.Locations.Length > 0)
            {
                if (e.Locations.Length == 1)
                {
                    this.radMap1.BringIntoView(new Telerik.WinControls.UI.Map.PointG(e.Locations[0].Point.Coordinates[0], e.Locations[0].Point.Coordinates[1]));
                }
                else
                {
                    this.radMap1.MapElement.BringIntoView(allPoints);
                    this.radMap1.Zoom(this.radMap1.MapElement.ZoomLevel - 1);
                }
            }
            else
            {
                RadMessageBox.Show("No result found for the provided search query!");
            }
        }

        Telerik.WinControls.UI.Map.Bing.SearchRequest request;
        private void radButton1_Click(object sender, EventArgs e)
        {
            Telerik.WinControls.UI.MapLayer pinsLayer = new MapLayer("Pins");
            this.radMap1.Layers.Add(pinsLayer);

            request = new SearchRequest();
            request.Query = "San Marino";
            request.SearchOptions.Count = 10;
            request.SearchOptions.QueryParse = true;
            request.UserData = "Tooltip";
            BingRestMapProvider bingProvider = this.radMap1.Providers[0] as BingRestMapProvider;
            bingProvider.SearchAsync(request);
        }

Workaround:  if possible cache the data to be accessed at a later stage
Unplanned
Last Updated: 17 Apr 2024 14:35 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: 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: 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: 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;
            }
        }
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);

            }
        }
    }
}

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
Unplanned
Last Updated: 06 Feb 2024 08:39 by ADMIN
Add support for reading JSON files encoded in GeoJSON format.
Completed
Last Updated: 30 Dec 2021 08:10 by ADMIN
Release R1 2022

The ShapeFileReader fails in its ReadDbfRecord method:

            using (MemoryStream shapeStream = new MemoryStream(File.ReadAllBytes(@"C:\Users\dyordano\Downloads\84aa4699-f436-4b7e-b029-e353fdab0411_shapefile-before-modification\asseuappareil.shp")))
            {
                using (MemoryStream dbfStream = new MemoryStream(File.ReadAllBytes(@"C:\Users\dyordano\Downloads\84aa4699-f436-4b7e-b029-e353fdab0411_shapefile-before-modification\asseuappareil.dbf")))
                {
                    ShapeFileReaderParameters parameters = new ShapeFileReaderParameters();
                    parameters.ShapeStream = shapeStream;
                    parameters.DbfStream = dbfStream;
                    ShapeFileReader reader = new ShapeFileReader();
                    List<MapVisualElement> elements = reader.Read(parameters);
                }
            }

Completed
Last Updated: 05 Jan 2022 10:27 by ADMIN
Release R1 2022
Created by: Sylvain
Comments: 1
Category: Map
Type: Feature Request
1
When RadMap is panned or zoomed, a respective event should be fired in order to detect the two operations.
Declined
Last Updated: 08 Oct 2020 11:00 by ADMIN
Created by: Steinar
Comments: 1
Category: Map
Type: Feature Request
1
Add functionality for saving the RadMap control to a svg file.
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 

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 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);
}
1 2 3