Closed (fixed)
Project:
Openlayers
Version:
7.x-2.x-dev
Component:
OL API
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
30 Aug 2009 at 03:05 UTC
Updated:
19 Jul 2012 at 20:42 UTC
Jump to comment: Most recent file
Comments
Comment #1
phayes commentedThere is no current way of doing this. This will require a patch.
There needs to be another option in the map array for min and max zoom. I'm tagging this as a 2.0 feature request.
Comment #2
phayes commentedComment #3
zzolo commentedComment #4
tmcw commentedThis is patched in 2.x. Works by letting maps define their own resolutions array, and then array.slice()ing that array into the required zoom levels, and reducing numZoomLevels to let all controls become aware of the new range. On commercial layers, minZoomLevel and maxZoomLevel are set.
Comment #5
looplog commentedgreat thanks, I'll check it out when I have a chance
Comment #7
Sinan Erdem commentedIs there a possible way to hardcode a maximum zoom-in level for Google maps in 1.x version? Virtual Earth maps currently have more zoom-in levels than Google maps.
Comment #8
tmcw commentedYou mean hardcode a maximum for Virtual Earth? Google Maps won't have more zoom levels if you just set OpenLayers to look for more. Also google layers seem to have more zoom levels than virtual earth by default?
Comment #9
Sinan Erdem commentedIf you have time, please check the map on this link: http://sofra.bilimternet.com/deneme
I generate this map with Views. I don't see any setting that I can set the max. zoom level for that map. When you play with available layers, you can see that Virtual Earth Hybrid map can zoom more than Google Hybrid map.
I want to make sure that users can zoom up to level 19 zoom on Gmaps... Right now, by default, it is at most 14 or 15 I think...
(Using OpenLayers 6.x-1.0-beta4)
Comment #10
tmcw commentedHey etcetera9, could you open a ticket for that problem in OpenLayers 6.1? This ticket is for the 2.x implementation, and that's somewhat dealt with. Also, that page looks pretty broken because of the Virtual Earth layer, and Google Maps is just going to give you blank tiles if you request zoom levels that it hasn't rendered yet?
Comment #11
Sinan Erdem commentedOf course, thank you...
Comment #12
tmcw commentedPer-layer zoom levels were added to the TMS layer type in 321258. I decided to go with a pure-PHP approach to this, just basically supporting 900913 serverResolutions in the layer type and then restricting resolutions in the per-layer settings. Note that this is a little weird as far as maps go, because zoomLevels is actually an index in this array: if you have zooms 0-13 and then knock off the first three, then zoomTo(0) starts going to 3 rather than 0. This is barely reasonable behavior from OpenLayers's perspective, but we'll have to deal with it for now. I'm going to add it to the other layer types in order, because this isn't going to be easy to do for everything - especially with the way that projections affect the code. Next up is OSM, because it's pretty much the same technique as TMS.
Comment #13
tmcw commentedper-layer zoom levels have been added to all layers for which they'll be immediately useful. There may be some more to add, and you can follow the pattern of TMS, OSM, etc.
Comment #15
narongwit12 commentedI have experienced this issue as well, and it is stil in 2 version too. When i switch to OSM, it can zoom into very detail of map but when i switch to google map, I can only zoom to certain extent. How can I make google map to have a max zoom like OSM do?
Best regards
Narongwit
Comment #16
narongwit12 commentedNarongwit
Comment #17
ejohnson commentedRe: #15 Did you find a fix for this, that you could share? Thanks.
Comment #18
tmcw commentedGoogle Maps has a variable actual level of zoom depth. The mapping library isn't generating the tiles - if it zoomed in further, you'd just see blank tiles.
Comment #19
jeffschulerI ran into the default numZoomLevels=15 being too limiting, too.
Cloning the default Google road maps layer and increasing "Number of Zoom Levels" to, say, 21 works well to fix this.
I find, though, (with 7.x-2.x-dev,) that setting the numZoomLevels to a really high number (I tried 300) doesn't have any ill effects -- OL seems to limit how far I can zoom to some sensible maximum... I don't have the ability to zoom too far and get blank tiles.
So, I wonder if it would be sensible to raise the default numZoomLevels from 15?
Patch for 6.x-2.x-dev attached.
Comment #20
jeffschulerre-rolled for 7.x-2.x-dev
Comment #21
cesareaugusto commentedWill this patch merged into the main 7.x dev release?
Comment #22
polThis patch fix the problem.
@cesareaugusto: Help us to reduce the issues here and we'll release a new version.
Comment #23
polThanks, committed.
http://drupalcode.org/project/openlayers.git/commit/b1e2921