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); } } } }
https://msdn.microsoft.com/en-us/library/ff701717.aspx
Until released use the following custom implementation: public partial class RoadOnDemandForm : RadForm { public RoadOnDemandForm() { InitializeComponent(); string cacheFolder = @"..\..\cache"; BingRestMapProvider bingProvider = new MyBingRestMapProvider(); bingProvider.Culture = System.Threading.Thread.CurrentThread.CurrentCulture; bingProvider.ImagerySet = ImagerySet.Road; bingProvider.UseSession = true; bingProvider.BingKey = "YourApiKey"; LocalFileCacheProvider cache = new LocalFileCacheProvider(cacheFolder); bingProvider.CacheProvider = cache; this.radMap1.MapElement.Providers.Add(bingProvider); } } public class MyBingRestMapProvider : BingRestMapProvider { private const string ImageryMetadataServiceUri = "https://dev.virtualearth.net/REST/v1/Imagery/Metadata/{set}?output=json&key={key}&c={culture}&dir={directory}"; protected override void InitializeImageryService() { typeof(BingRestMapProvider).GetField("tileMetadataInfo", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.NonPublic).SetValue(this, null); try { string uriString = ImageryMetadataServiceUri; uriString = uriString.Replace("{set}", "RoadOnDemand"); uriString = uriString.Replace("{key}", string.IsNullOrEmpty(this.SessionId) ? this.BingKey : this.SessionId); uriString = uriString.Replace("{culture}", this.Culture.ToString()); uriString = uriString.Replace("{directory}", "0"); WebClient client = new WebClient(); client.DownloadStringCompleted += this.InitializeImageryMetadataCompleted; client.DownloadStringAsync(new Uri(uriString, UriKind.Absolute)); } catch (Exception ex) { throw new Exception(string.Format("Imagery Service Exception: {0}", ex.Message)); } } }
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)); } }
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
Hi,
An exception is thrown while adding layers without name. (System.InvalidOperationException: 'A layer with the same Name already exists in the collection.')
i.e
var layer1 = new MapLayer();
var layer2 = new MapLayer();
map.Layers.Add(layer1);
map.Layers.Add(layer2);
The simple fix is to always pass a unique name, but it must work like say DataTable.Columns.Add(); (which internally generates unique name)
Thanks