Tile map service CORS errors

Hi,

I tried to create a map with a tile map service with the url

https://tiles.openrailwaymap.org/standard/{z}/{x}/{y}.png

but the tiles are not loaded, and the debug-console of the browser tells me:

Blockquote
Access to fetch at 'https://tiles.openrailwaymap.org/standard/2/1/2.png' from origin 'http://172.30.36.129:5601' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
Blockquote

The default layer from openstreetmap works without a problem.

I already configured cors in the kibana.yml with the parameters:

server.cors: true
server.cors.origin: ["*"]

I'm running elasticsearch and kibana in version 7.5.1 in a docker-environment.

What am I doing wrong?

Hi @rainae

Are you using Elastic Maps, right? The problem is that openrailwaymap is not supporting CORS requests.

Other tile servers that support CORS you can try:

  • Stamen Watercolor: https://stamen-tiles.a.ssl.fastly.net/watercolor/{z}/{x}/{y}.jpg
  • CARTO voyager https://a.basemaps.cartocdn.com/rastertiles/voyager_labels_under/{z}/{x}/{y}.png
  • CARTO positron https://a.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png

The only workaround I can think about is to set up your own reversed proxy that actually supports CORS if you really need that server.

1 Like

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.