Completed
Last Updated: 07 Feb 2020 16:13 by ADMIN
Release R1 2020
Petar
Created on: 07 Jan 2020 16:50
Category: Map
Type: Bug Report
7
Map: OpenStreetMap provider does not follow the latest OpenStreetMap tile usage policy requiring UserAgent header.

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.

Currently, the workaround is to override the OpenStreetMapProvider like so:

    public class CustomOpenStreetProvider : OpenStreetMapProvider
    {
        public CustomOpenStreetProvider()
        {
            OpenStreetMapnikSource osmMapInkSource = this.MapSources.Values.ToList()[0] as OpenStreetMapnikSource;
            if (osmMapInkSource != null)
            {
                osmMapInkSource.WebHeaders.Add(System.Net.HttpRequestHeader.UserAgent, "your custom user agent string");
            }
        }
    }
3 comments
ADMIN
Petar Mladenov
Posted on: 07 Feb 2020 16:13

Hi Jan,

We have contacted the OpenStreetMaps development team on this question - service gets slower when user-agent is provided but unfortunately we do not have an answer. If performance is critical to some users, we suggest using a other mode which does not require user agent or other map provider.

Regards,
Petar Mladenov
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Jan Heiko Houtrouw
Posted on: 05 Feb 2020 14:36
With Release R1 2020 the Map using the Open Street Map Provider still performs very slowly ...
Petar
Posted on: 09 Jan 2020 14:49
In R1 2020, we will add StandardModeUserAgent property to OpenStreetMapProvider for easier setup.