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)); } }
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
To reproduce:
set the clustering and add some pins upon a button click.
Workaround
Refresh with the following method:
Please refer to the sample project and follow the steps:
1. Run the attached application.
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
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.
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
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);
}
}
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:
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.
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(); } }
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.
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); } } } } }
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.
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