NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum

Is there a way to control the granularity of the map zoom levels using OpenLayers? That is, my boss keeps complaining that on smaller monitors zoom level 5 is too close (it cuts off part of the state), but zoom level 4 is too wide (it shows a lot of the surrounding map and makes the markers too crowded). Ideally, I would like to be able to smoothly zoom in to the exact level I want, but even if I could just get one or two more discrete zoom levels in the proper range I would be happy. Is this possible?

asked 16 Jul '12, 19:46

ibrewster's gravatar image

ibrewster
16111
accept rate: 0%

edited 16 Jul '12, 19:49

SomeoneElse's gravatar image

SomeoneElse ♦
36.9k71370866


I am not sure if this is meant to be an OpenStreetMap question or an OpenLayers question. If it is an OpenLayers question then this is the wrong place to ask; therefore I'll treat it as if you were asking for OSM specifically.

OpenStreetMap data on the OSM tile server is rendered to tiles on the fixed zoom leves that you see. You have two options:

  • interpolate - i.e. take the zoom level 5 tiles and reduce them a bit, or take the zoom level 4 tiles and increase them a bit. This is what the web site http://www.khtml.org/ does, where you can select intermediate zoom levels.
  • render your own map (enter "render map" in the search box above to find details) - if you do that then you can specify exactly which area and size you want and the renderer will do its best to fulfil the request.
permanent link

answered 16 Jul '12, 19:55

Frederik%20Ramm's gravatar image

Frederik Ramm ♦
82.5k927201273
accept rate: 23%

Another noddy way of getting a map at half-zoom-level, is to tell your browser to zoom. 'View' menu. Zoom out.

This works with firefox and safari. Not sure about I.E. It amounts to the interpolation technique federik describes, which introduces unpleasant scaling artefacts. In fact because the browser is scaling quickly on-the-fly, it'll not do a particularly nice job of it. It can even result in spurious gridlines appearing (pixel gaps between tiles). In other words this is a completely half-assed solution :-)

Having said that, I've actually found this handy on a number of occasions when trying to get a quick map screenshot (usually for creating cake diagram images) Don't forget to do view -> zoom -> reset afterwards though.

permanent link

answered 17 Jul '12, 16:28

Harry%20Wood's gravatar image

Harry Wood
9.5k2588128
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×362
×122
×107
×99

question asked: 16 Jul '12, 19:46

question was seen: 10,276 times

last updated: 17 Jul '12, 16:28

NOTICE: help.openstreetmap.org is no longer in use from 1st March 2024. Please use the OpenStreetMap Community Forum