leaflet-grayscale icon indicating copy to clipboard operation
leaflet-grayscale copied to clipboard

Grayscaling does not work with some tiles

Open rurseekatze opened this issue 10 years ago • 5 comments

Grayscaling does not work with tiles from http://a.www.toolserver.org/tiles/osm-no-labels/10/530/340.png.

Example: Visit http://www.openrailwaymap.org/ and select the "Mapnik no-labels Grayscale" layer from the layerselection. You will see just an empty background.

rurseekatze avatar Apr 04 '14 20:04 rurseekatze

Yes, and it prints "Security Violation" to the error log. Very strange, considering it works with standard tiles from osm.org.

Zverik avatar Apr 07 '14 12:04 Zverik

OK, there seems to be a problem with crossOrigin. I think this is related to this problem: http://blog.chromium.org/2011/07/using-cross-domain-images-in-webgl-and.html

Is there any way to solve this problem clientside or should I suggest the provider of the tileserver to modify the response headers?

rurseekatze avatar Apr 11 '14 20:04 rurseekatze

I have noticed that the gray layers at OpenRailwayMap (Mapnik gray and Mapquest gray) are not visible if the plugin HTTPSeverywhere works. If I look into the Firefox console, I do not see HTTP GET requests for map tiles of tiles.openstreetmap.org while moving the map. I only see HTTP GET request for tiles.openrailwaymap.org (this layer is not gray-converted).

Layers which are not converted from RGB to gray are shown as usual.

Nakaner avatar Jan 14 '15 22:01 Nakaner

I tried using this with the following map:

http://otile{s}.mqcdn.com/tiles/1.0.0/map/{z}/{x}/{y}.jpg

And indeed It showed some diagonals tiles wrong. Then I moved to:

http://tile.openstreetmap.org/{z}/{x}/{y}.png

And it worked pretty good. My approach is a little bit different because I'm caching the first 3 zoom levels on my own server to reduce bandwith consumption to openstreemap (it's more of an ethical matter than technical) and I also comprised the png images by my own, reducing them up to the 35% of the original size. This way the images are served faster and more reliable.

Yes, this works. And it works real good. It is a fair alternative to the old Acetate (Hillshading).

nebadom avatar Feb 02 '16 23:02 nebadom

Doesn't work for me with secured tiles. Is this problem solved? Any advice?

ghost avatar Oct 28 '18 10:10 ghost