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 |
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. answered 15 Aug '13, 15:33 gormo 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
(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
|