I've scanned an old map from around 1912 and created a tile set. The set contains tiles for zoomlevels 11-16 and covers only a small area. When using it with OpenLayers I get error messages in the log for the not coverd parts around the map – not suprising but not necessary.

So how to tell OpenLayers for wich area tiles should be available and for which not. Same with the zoom levels. Setting numZoomLevels to 6 makes the Layer available for level 1-6 but how to to that for 11 to 16?

Thanks

asked 15 Aug '13, 13:21

Ogmios's gravatar image

Ogmios
721192438
accept rate: 25%


Set (max|restricted)Extent on the map, see http://dev.openlayers.org/releases/OpenLayers-2.13.1/doc/apidocs/files/OpenLayers/Map-js.html#OpenLayers.Map.restrictedExtent . Experiment with those, I don't know which one you'd need.

For the zoom level restrictions see the example from openlayers. http://dev.openlayers.org/releases/OpenLayers-2.13.1/examples/bing-tiles-restrictedzoom.html

Generally those examples are a very good source of information and guidance on how to do things.

permanent link

answered 15 Aug '13, 15:33

gormo's gravatar image

gormo
2.9k32660
accept rate: 13%

1

The example doesnt fit. With numZoomLevels i can Use zoom level 1-5 not 11-16 as I want.

(15 Aug '13, 15:38) Ogmios

Whats with the other examples tagged zoom? http://openlayers.org/dev/examples/?q=zoom . I'd guess you have to play around with the scales parameter.

(15 Aug '13, 16:02) gormo

Yes I did but I can't get it working – at least not completely. I can add it as a whole layer and hide the error-tiles via css, at the moment thats the best way. But I can't get it to show the layer only within the given borders and especially not limited to the given zoom levels. That seems to be much easyer with leaflet. But I'm not an experienced web developer so It's very likely that I'm doing something completely wrong.

(20 Aug '13, 20:54) Ogmios
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:

×243
×2

question asked: 15 Aug '13, 13:21

question was seen: 2,051 times

last updated: 20 Aug '13, 20:54

powered by OSQA