Closed (fixed)
Project:
Openlayers
Version:
7.x-2.x-dev
Component:
OL Layers
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
29 Sep 2010 at 13:18 UTC
Updated:
9 Apr 2014 at 08:11 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
tmcw commentedI believe this fix should have fixed this: #939400: XYZ Layer causes js error and will not load. Try updating to -dev and check?
Comment #2
cajmcmahon commentedThanks to all. The dev version works and a cloned map will now render.
However, when I eliminate "Zoom Level Ranges" 0 and 1 the tiles won't load (please see attached screenshot).
I'm trying to prevent users from zooming all the way out creating a tiny map.
I'll keep trying...
Thanks again.
Comment #3
tmcw commentedThis is an upstream bug; the OpenLayers.js implementation of XYZ layers doesn't support zoom level limitations on the top end (yes; it's annoying and stupid, and bad design. I'm not in love with the design of the javascript library).
You'll need to put an error report on OpenLayers.org for this if you want it to get fixed.
Comment #4
coredumperror commentedI recently tried to do the same thing as cajmcmahon, cloning the OSM Mapnik layer so I could apply zoom level limitations. However, when I use that cloned layer, if any set of zoom levels (even 0 and 1) has been chosen in the Zoom Level Range multiselect, the "z" value for every single tile at every zoom level apparently gets set to -1. This causes every tile request made to tile.openstreetmap.org to result in a 404 Not Found error (according to the Net tab on Firebug. e.g
http://tile.openstreetmap.org/-1/11263/26150.png). If I unselect every value in the Zoom Level Range control, the layer starts working fine.Is this still a problem in the OpenLayers library end, or is it a bug in the drupal module? This was last addressed in late 2010, and I imagine that both have changed dramatically since then, so I'm hoping that this issue can now be resolved.
I'll do my best to root around in the code and figure out where the problem is originating, but I wanted to bring it up here so that the folks who actually know what they're doing might be able to shed some light on the issue.
Comment #5
coredumperror commentedI did some rooting around in the OpenLayers issue tracker and found this:
http://trac.osgeo.org/openlayers/ticket/2189
The 3-month-old patch from this issue hasn't gone into a live OpenLayers library release yet, but as you can see in the link from the second to last post (http://openlayers.org/dev/examples/bing-tiles-restrictedzoom.html), it is definitely now possible to do a zoom-limited layer. It doesn't appear to support the kind of granlarity that the edit control in this module's Layer editor allows, though. But simply being able to limit the zoom level to e.g. 15-18 is entirely possible now.
I'll see about writing up a patch to the module that will utilize the patched library functionality.
Comment #6
zzolo commentedThanks for digging into that @coredumperror . Marking as a feature request, then.
Comment #7
coredumperror commentedWell, I don't really think this is a feature request. Right now the OpenLayers module has interface functionality for limiting the zoom level for a layer, and it doesn't work. In fact, using it at all completely breaks the layer.
This is going to be an important feature of the site I'm writing, so I'll go ahead and assign this to myself. I should have a patch within a week or so.
Comment #8
cableman0408 commentedI'm trying to display a local map from a MapBox TileStram server, but the z part of the server request is always -1. I think it's related to the issue described here.
I have create a patch that makes the map display, but not sure that it fixes the whole problem, but maybe it can help getting the problem resolved correctly.
Comment #9
polHello,
Can you try with the latest dev release and report back ?
Re open the ticket if needed.
Thanks !
Comment #10
coredumperror commentedYes, this still happens in the newest dev release. I tried setting the OSM Mapnik layer to only allow zoom levels of 15-18, and every map tile broke in the same way (the 'z' part of the tile image's URL was -1).
Comment #11
polAnd now ?
Comment #12
coredumperror commentedI installed the Feb 02 dev build, and it also didn't work... but it did cause different errors than last time.
1) The edit forms for XYZ style Layers have the "Zoom Level Range" form element twice. As seen here.
2) Rather than showing broken images in the place of tiles, setting the Zoom Level Range now causes the entire map to not render at all. Checking the Network tab on the Chrome Inspector shows that it's not even attempting to download tiles.
2a) Upon further testing, I've discovered that setting the Zoom Level Range in the top form element (as seen in my screenshot) causes this "no render" error. But setting it in the bottom form element causes the original "broken tiles" effect (even when the top element is also set). I see it trying to download tiles with incorrect URLs like
http://tile.openstreetmap.org/0/0/13074.png. At least it's not trying to download tiles with "-1" in the URL anymore.Comment #13
polThanks for trying coredump,
I'm trying to understand how 'serverResolutions' and 'resolutions' keys are working.
I will work on the layer form again soon and I will add some more documentation.
Any insight is welcome to help me !
I'll come back on this thread as soon as I made any progress.
Comment #14
friedjoff commentedBoth fields for zoom level ranges in XYZ layers appear with the same title and description. This patch changes the title and description for the serverResolutions field.
Comment #15
polThanks @friedjoff, committed !
Comment #16
pol