I noticed (in Leaflet More Maps, http://drupal.org/project/leaflet_more_maps) that the default max zoom for this module is 18. However, Google maps seem to go further.. ~21 or so. With Openlayers and GMap I'm able to zoom to 21. At levels past 18 the Satellite mode goes from flat to 45degree mode (where you see the buildings at an angle).
Anyways, I'm just wondering if it is possible to activate higher zoom levels for the google api layers? I tried to set the maxZoom to 20 in the module code and it makes the tiles go away :) so that was obviously not the problem. I will look deeper but maybe you already know the answer to this.
Thanks again for all your work.
| Comment | File | Size | Author |
|---|---|---|---|
| #9 | error-tile.png | 2.79 KB | socialform |
| #9 | no-imagery.jpg | 107.16 KB | socialform |
| #4 | Pope Joan.png | 1.95 MB | rdeboer |
Comments
Comment #1
rdeboerInteresting...
I'm just guessing, haven't gone into it deep yet, but it probably means that we have to change to a different urlTemplate (i.e. a different tile set) beyond zoom level 18.
Rik
Comment #2
socialform commentedYes, that makes sense.
Here's what the tile URL looks like for Google Sattelite at zoom 20 via an old GMaps site I had running:
http://khm0.googleapis.com/kh?v=85&hl=en°=0&x=180034&y=449479&z=20And here's what the URL looks like from Leaflet More Maps (zoom 18):
http://khm0.googleapis.com/kh?v=167&x=45010&y=104620&z=18I tried replacing the Url template on line 206 with:
$prot . 'khm{s}.googleapis.com/kh?v=85&hl=en°=0&x={x}&y={y}&z={z}but I think it doesn't work because the X and Y variables are not getting the correct values.
I'm not a coder so I'm stumbling around in the dark looking for solutions :)
By the way this work is going into a great site for a non-profit art project called the American Land Museum.
http://alm.archivalmedium.com
It's a upgrade from their old site http://www.clui.org/ludb.
The new site will use IP Geo + Leaflet + Leaflet Hash + Leaflet More Maps if I can get this last zoom issue resolved. We were going to go with Openlayers but this combination works so much better and is much lighter weight. Thanks to you for all your work on these various modules!
Comment #3
rdeboerGreat project, http://alm.archivalmedium.com!
And now some great news to go with it!
I could not get your URL from the GMaps site to run.
I then started poking around in the various Leaflet modules and libraries to see whether the common maxZoom limit of 18 was perhaps hard-coded and overriding what some maps are capable of.
Guess what? The file sites/all/libraries/leaflet/leaflet.js is wrong!
should be
To fix this, cd into sites/all/libraries/leaflet. Rename leaflet.js to leaflet.min.js (this is your backup, in case you wish to revert).
Then rename leaflet-src.js to leaflet.js.
Then find the above lines in your new leaflet.js at line #2432.
Load the latest version of Leaflet More Maps, 7.x-1.x-dev which I just prepared today.
Clear caches.
The urlTemplate used is still v=167, but the new 7.x-1.x-dev allows you increase the zoom level to 21. Make sure you go into the IPGV&M map settings at the very bottom to change the maximum zoom level which might still be sitting on the old value of 18. Set it to 21.
Now I'm wondering whether some of the other maps also have maxZoom limits higher than 18 that we never found because of the hardcoded limit (for no good reason) in the Leaflet JS!
Comment #4
rdeboerHere's the new code in action: a Google satellite map at zoom 21 of the cafe where I discovered this.
It took more than a couple of coffees to figure it out, but I'm sure you would agree it was worth it.
PS: it doesn't do the 45 degree angle... Not sure how to invoke that. I played with "deg=45" but got errors....
Comment #5
rdeboerI fixed up some of the other Leaflet More Maps as well. Please note comment in #3: needs the one-line patch from the Leaflet JS lib.
Rik
Comment #7
socialform commentedI owe you a beer if you're ever in Los Angeles. Amazing!
I didn't see the dev version of Leaflet More Maps yet... only 7.x-1.11. But I was able to modify its maxzoom to 22. And I found the "maxZoom: 18" in the leaflet minified .js and changed it there. Thanks for that.
I found that I only had satellite imagery up to 21 where I'm looking so I limited it to 21 in the Views settings... but maybe 22 exists somewhere. And actually 22 worked fine for street and terrain modes but it didn't seem necessary.
One suggestion in case you get time down the road (you've helped me enough): the map goes gray when it can't find tiles... like in the rural and oceanic areas where you only have tiles down to zoom levels like 16. With standard Google maps it says "sorry, we have no imagery here". Just a thought for usability... considering all the different map layers and varying zoom limits.
As for the 45 degree thing, I kind of like the non 45 degree images better. The one exception is that the 45 deg images are crisper.
Thanks a million and yes, definitely worth a couple of coffees ;)
Comment #8
rdeboerAll good!
Re: "the map goes gray when it can't find tiles"...
Don't think I can do anything about that if I wanted too...
The module has no a-priori knowledge of whether a request for a tile will return a result and then when the tile image indeed arrives, it cannot simply detect in a snip if that image is empty or not.
Might take you up on that beer offer. Not planning on going to DrupalCon US this year, but one never knows where one ends up down the track.
Happy mapping!
:-)
Comment #9
socialform commentedI figured out how to replace the tiles if they are missing because of zoom level.
If anyone is looking for this too, here's how:
1. make your custom tile. It should be 256x256 pixels and can be a PNG or JPG
2. edit sites/all/libraries/leaflet/leaflet.js
Search for
errorTileUrl:""and place the URL to your custom tile between quotes.here's a sample transparent PNG:

Comment #10
rdeboerThis is great socialform!
It is actually a Leaflet fix, more so than a Leaflet More Maps fix.
In fact most of this issue is.
Both our fixes involve hacking Leaflet JS, but could potentially be affected more elegantly via Leaflet-the-Drupal-module.
Maybe we should move this issue to the Leaflet issue queue, so that it is more easily found?
Rik
Comment #11
rdeboerComment #12
socialform commentedYes, you're right RdeBoer, good call.
Comment #13
socialform commentedComment #14
1mundus commentedHi Rdeboer,
I have installed the new version (2015-Mar-16) and zooming in works after changing maxzoom to 21 in leaflet.js.
However, when using Views in map settings I still see max zoom restricted to 18, although it seems to work up to 21.
Also, how did you get all of those buttons in the left side? I have only + and - . I don't have a small map in the bottom right corner either.
My Leaflet version is 7.x-1.1+14-dev.
Comment #15
rdeboer@1mundus
The screenshot from #4 was created by adding http://drupal.org/project/ip_geoloc 7.x-1.x-dev to the mix.
New official release of that module is due this week.
Rik
Comment #16
1mundus commentedOK, thank you for that.
What about max zoom setting in Views? Can you reproduce that?
Comment #17
rdeboerhttp://drupal.org/project/ip_geoloc comes with its own Initial and Max zoom settings.
They in the bottom field set when you configure the map in Views. It's very much like Leaflet except with more options, for all sorts of stuff.
Have a go and let me know if you are disappointed!
Rik