Bug Report T745053
Visible to All Users

OpenStreetMap provider does not display Basic tiles in the MapControl demo application

created 6 years ago

Hi

Seems there is a general problem regrading OSM-tiles and DevExpress.XtraMap.MapControl. Using Fiddler I can see that OSM is now returning a ERR_ACCESS_DENIED. If I request the tile in Chrome there is no problems.

Any workarounds?

Request:

HTML
GET http://c.tile.openstreetmap.org/4/7/5.png HTTP/1.1 Referer: http://www.openstreetmap.org/ Accept: image/* Host: c.tile.openstreetmap.org

Response:

HTML
HTTP/1.1 403 Forbidden Server: squid/2.7.STABLE9 Date: Tue, 28 May 2019 14:05:35 GMT Content-Type: text/html Content-Length: 1207 X-Squid-Error: ERR_ACCESS_DENIED 0 X-Cache: MISS from rimfaxe.openstreetmap.org X-Cache-Lookup: NONE from rimfaxe.openstreetmap.org:3128 Via: 1.0 rimfaxe.openstreetmap.org:3128 (squid/2.7.STABLE9) Connection: close ERROR: The requested URL could not be retrieved <!-- %l body :lang(fa) { direction: rtl; font-size: 100%; font-family: Tahoma, Roya, sans-serif; float: right; } :lang(he) { direction: rtl; } --> ERROR The requested URL could not be retrieved The following error was encountered while trying to retrieve the URL: http://tile.openstreetmap.org/4/7/5.png Access Denied. Access control configuration prevents your request from being allowed at this time. Please contact your service provider if you feel this is incorrect. Your cache administrator is webmaster@openstreetmap.org. Generated Tue, 28 May 2019 14:05:35 GMT by rimfaxe.openstreetmap.org (squid/2.7.STABLE9)

Kind regards, Ole

Show previous comments (7)
RB RB
Roland Beenhakker 6 years ago

    The solution works, but is very slow on my end.
    And beware that this only needs te  be done for Basic map type. Other types like Transport, will not work over https.

      Following the proposed solution by Sergey and montioring the https traffic with Fiddler, I get:

      HTTP/1.1 429 Too Many Requests

      which leads again to no tiles being displayed …

      Any ideas how to solve this?

        Ok, I forgot to set the user-agent header together with the referer, so now fiddler shows a 200 status code.

        Answers approved by DevExpress Support

        created 6 years ago (modified 5 years ago)

        We have fixed the issue described in this ticket and will include the fix in our next maintenance update. To apply this solution before the official update, request a hotfix by clicking the corresponding link for product versions you require.

        Note: Hotfixes may be unavailable for beta versions and updates that are about to be released.

        Additional information:

        We have changed the protocol from HTTP to HTTPS of OpenStreetMap's Basic layer tile requests; also WebRequest.Referer works now through the HTTPS protocol.

        It is also required to handle the DataProvider.WebRequest event to set the e.Referer and e.UserAgent properties when connecting to the public OSM server.

        C#
        private void OpenStreetMapDataProvider_WebRequest(object sender, MapWebRequestEventArgs e) { e.Referer = "https://www.openstreetmap.org/"; e.UserAgent = "com.mycompany.myapp"; }

        Note that we do not recommend using the public OSM server (see Tile usage policy). Instead, use alternative tile servers by setting the TileUriTemplate property.

          Show previous comments (28)
          DevExpress Support Team 6 years ago

            Hi Mats,
             
            I have tested the MapControl demo application on my side and confirm that OSM tiles are loaded correctly although the loading speed is rather slow.
            By default, we use the public OSM server via the HTTPS protocol. You can also test the HTTP protocol which is faster (see the sample project from the MapControl's OpenStreetMapDataProvider fails to display ticket).
             
            A better solution is to use alternative tile servers when setting the TileUriTemplate property because the public OSM server has some limitations (see the Tile Usage Policy article).

              I tested the T751994 sample. That was all I needed.
              Thanks

              DevExpress Support Team 6 years ago

                Thank you for your confirmation, Mats.

                Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

                Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.