-
Notifications
You must be signed in to change notification settings - Fork 472
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[suggestion] Possibility to also serve retina tiles #154
Comments
You could extend from the image with your own separate Dockerfile like:
And then use your own extended image everywhere instead of building the base image again. (There's a way to have real line breaks inside of the RUN command with other quotes, so that it's not so ugly. I don't remember the specific syntax for it right now.) Or, you could copy the contents of
|
Some tips (learned the hard way) for creating & using retina tiles this way:
|
Thank you @Istador, I'm quite a noob with docker and you way of extending the image is actually much cleaner! @MaRaSu that's very interesting! thanks! I've integrated these tiles on the web (using leaflet) and on mobile (using React Native's Given @Istador 's suggestion, maybe you can close this issue if you want! I thought I'd help a tiny bit with what worked for me and surely other people will need as well. |
I tried to figure out how to do this, but new to Docker, as I am, did not succeed so far. Can you help me further? |
Could you please check the directories with the latest build? The scripts seems broken. Thank you!! |
I managed to locate renderd.conf with your help at its new location. But Retina tiles still do not work with your latest build. What is wrong with this: FROM overv/openstreetmap-tile-server:latest RUN bash -c 'echo -e "[map_retina]\nURI=/tile@2x/\nTILEDIR=/var/cache/renderd/tiles\nXML=/home/renderer/src/openstreetmap-carto/mapnik.xml\nHOST=localhost\nMAXZOOM=19\nSCALE=2.0\nTILESIZE=512\n" >> /etc/renderd.conf' ?? :-| |
@Naahuel or @Istador or anyone else: I have spend so many hours now - a year ago the retina tiles still worked, but with the latest build and the Dockerfile mentioned above the tiles at http://localhost:8080/tile@2x/{z}/{x}/{y}.png just look identically to the ones at http://localhost:8090/tile/{z}/{x}/{y}.png If anyone knows how to fix this, I would be most grateful. Something must have changed in the latest build of overv/openstreetmap-tile-server, so that adding the above commands to renderd.conf no longer works. |
Works fine for me.
FROM overv/openstreetmap-tile-server:2.3.0
RUN bash -c 'echo -e "[map_retina]\nURI=/tile@2x/\nTILEDIR=/data/tiles\nXML=/data/style/mapnik.xml\nHOST=localhost\nMAXZOOM=20\nSCALE=2.0\nTILESIZE=512\n" >> /etc/renderd.conf' Commands: docker build . -t osm-local
docker run --rm -v osm-data:/data/database/ osm-local import
docker run --rm -v osm-data:/data/database/ -p 80:80 osm-local run
curl -o 1x.png http://localhost/tile/0/0/0.png
curl -o 2x.png http://localhost/tile@2x/0/0/0.png The changes between |
:-) Thank you so much - got it to work again! No idea, why it did not work before. I started from scratch with your Dockerfile. Is there any pointer anywhere to how to use different styles, i.e. instead of the openstreetmap-carto style, i.e. where can I find appropriate files (one lua script, one style, one mml, and one one SQL)?? |
Following up on #33 and thanks to @MaRaSu 's suggestion, I added this line in the Dockerfile:
Which essentially adds this entry to
renderd.conf
:And now I can get tiles at the usual URL but also at
http://localhost:8080/tile@2x/{z}/{x}/{y}.png
It seems like the preferred URL template seems to be
http://localhost:8080/tile/{z}/{x}/{y}@2x.png
but every kind of map you integrate it on allows you to use any URL template you want so I don't see this as a problem.That RUN line is a bit ugly but I guess it works, I'm not very good at this. If this is something that interests you maybe you can optimize it.
The text was updated successfully, but these errors were encountered: