This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Set zoom level

0

When I rendered local OSM tiles for India data. It's showing the output as below. How can I change the zoom level![alt text][1] such that India map is show clearly.

https://imgur.com/87wcKnP

Here's the link for image

asked 07 Jun '19, 12:14

Puranjay's gravatar image

Puranjay
11223
accept rate: 0%


2 Answers:

2

You load the tile /0/0/0.png. Tiles are sorted into folders and names like this: {z}/{x}/{y}.png. So if you change your query to /1/0/0.png you will go one zoom level up.

Maybe you are looking for a real frontend to draw a map and zoom with your mouse? Check out Leaflet or Open Layers. It's also documented on the swith2osm site you are following.

answered 07 Jun '19, 12:35

TZorn's gravatar image

TZorn
12.3k764225
accept rate: 15%

So is there any way to figure out values of {X}, {y} and {z} to see entire map or it's just hit and trial.

(07 Jun '19, 12:40) Puranjay

https://imgur.com/XM9EHBb

I have changed url to 'localhost/hot/{z}/{x}/{y}.png' and some images are not loading as showing in console.

(07 Jun '19, 13:07) Puranjay

You might have hit a timeout if the tiles weren't already rendered. Try refreshing to see if they are now available.

(07 Jun '19, 13:31) EdLoach ♦
1

If you want to work out x, y and z values, see https://wiki.openstreetmap.org/wiki/Slippy_map_tilenames

(07 Jun '19, 13:34) EdLoach ♦

1

In a comment on an answer to your other question, I mentioned that https://switch2osm.org/manually-building-a-tile-server-18-04-lts/ suggests "In order to see tiles, we’ll cheat and use an html file “sample_leaflet.html” in mod_tile’s “extras” folder".

That's an HTML file that uses Leaflet (a Javascript library) to fetch the appropriate tiles so that you can view a full map. It's probably the easiest way to achieve what you want, but it would help if you explained what you want a map for - do you want to embed something in a web site, print it out, something else?

answered 07 Jun '19, 14:23

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866
accept rate: 16%

Source code available on GitHub .