Hi,
I am attempting to use a XamGeographicMap to display OpenStreetMaps imagery, but no map data is displayed, only whatever background color is behind the map. In the main application, I have a custom control based on XamGeographicMap, and a couple GeographicShapeSeries. The Series display just fine, and zoom/pan function as well. In order to avoid any funny business with visibility or styling or anything like that, I did a test in a separate application containing just the basic setup found on the help pages (Adding XamGeographicMap to a Page and Using Geographic Imagery), and got the same results, code and results are below. This did show that 8 System.Net.WebExceptions were being thrown (they were lost in the other output of the main application), each of them stating "The remote server returned an error: (429) Too Many Requests". Any thoughts on causes and/or fixes?
I am using version 18.1
Thanks in advance.
MainWindow.xaml
<Window x:Class="GeographicMapTest.MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:ig="http://schemas.infragistics.com/xaml" xmlns:local="clr-namespace:GeographicMapTest" mc:Ignorable="d" Title="MainWindow" Height="450" Width="800"> <Grid> <ig:XamGeographicMap x:Name="GeoMap"> <ig:XamGeographicMap.BackgroundContent> <ig:OpenStreetMapImagery /> </ig:XamGeographicMap.BackgroundContent> </ig:XamGeographicMap> </Grid> </Window>
MainWindow.xaml.cs
using System.Windows; namespace GeographicMapTest { public partial class MainWindow : Window { public MainWindow() { InitializeComponent(); } } }
Resulting window
Hello,
we have the same problems with OpenStreetMap here. Are there any news about this case ?
We are using the Version 18.1 (update is possible).
It appears that this is a known issue with Open Street Maps, and it is actually due to a modification on their side. They made a change where they are now a bit stricter and now require a referrer and user agent for use with their web request headers. However, we can provide you a workaround where this issue is resolved by utilizing the DownloadingImage and CancellingImage events of the OpenStreetMapImagery.
<ig:XamGeographicMap x:Name="map" OverviewPlusDetailPaneVisibility="Visible" > <ig:XamGeographicMap.BackgroundContent> <ig:OpenStreetMapImagery DownloadingImage="OpenStreetMapImagery_DownloadingImage" CancellingImage="OpenStreetMapImagery_CancellingImage"/> </ig:XamGeographicMap.BackgroundContent> </ig:XamGeographicMap>
However, this workaround could be applied in version 19.1 and above. Having this in mind I can suggest you to upgrade to the latest version.
A simple sample that contains this workaround could be found here. Please test it on your side and let me know if I may be of any further assistance.
Let me know if I may be of any further assistance.
Sincerely,
Teodosia Hristodorova
Associate Software Developer