since #1159328: TMS baselayer functionality we have the baselayer switcher available when defining TMS layers. this enables to define a layer as either baselayer or overlay layer.
when i use the overlay functionality with a custom MBTiles tilemill export with zoom levels 0-8 there is a problem that the map won't work for certain zoom levels. for zoom levels great than 4, the zoom-level part of the tile image links being generated will be set to -1 instead of the correct value from 5-8:
http://mysite/1.0.0/my_map/-1/18/20.png
as tmcw stated in the #mapbox irc channel there seems to be some PHP number conversion problem in D7 but we couldn't really figure out how exactly that's being caused...
Comment | File | Size | Author |
---|---|---|---|
#10 | zoom-level-error-1165350-10.patch | 755 bytes | mgifford |
Comments
Comment #1
zzolo CreditAttribution: zzolo commentedFrom this old issue, it seems like it is a general problem with floats and resolutions. #842026: Resolutions arrays must be cast to strings for export (marking other as duplicate)
Comment #2
dasjointeresting, do you think there is an easy fix to that issue?
Comment #3
dasjoi'm currently travelling central america to do some presentations about drupal and i would love to show tilemill integration as well. would be great if there was some fix / workarround to the issue described above as it basically prevents custom tilemill maps from being shown using openlayers.
zzolo, can you think of a way to tackle this? i am happy to do some testing here
Comment #4
MW CreditAttribution: MW commentedi have modified the following file
all\modules\openlayers\js\openlayer.js at lines 64 and 70 for tms basemaps
// TODO: work around this scary code
if (map.projection === '900913') {
options.maxExtent = new OpenLayers.Bounds(
-20037508.34, -20037508.34, 20037508.34, 20037508.34);
options.units = "m";
}
if (map.projection === '4326') {
options.maxExtent = new OpenLayers.Bounds(-180, -90, 180, 90);
}
options.maxResolution = "auto"; //1.40625;
options.controls = [];
Comment #5
zzolo CreditAttribution: zzolo commentedHi @MW. What exactly did you change? Can you provide a patch that is compbatible with everything else.
Comment #6
dasjoi will see if i can test this those days
Comment #7
MW CreditAttribution: MW commentedlines modified:
added
options.units = "m";
options.maxResolution = "auto"; //1.40625;
changed 1.40625 to auto
this was from an earlier post re drupal 6 openlayers WMS and not changed for drupal 7 code
Using WMS as a Baselayer resolution issue
http://drupal.org/node/878644
Comment #8
dasjoi just tried MW's proposed fix, but it doesn't work in my case.
Comment #9
zzolo CreditAttribution: zzolo commentedCan someone make an actual patch to test out?
Comment #10
mgiffordHere's a patch against the git repository to test.
Comment #11
zzolo CreditAttribution: zzolo commentedThese changes have been made to 7.x-2.x. Testing would be appreciated.