As per the title, is there a way to increase the maximum zoom of maps in openlayers? I'm finding the google sat maps are not able to zoom in to the degree they can in the gmap module. I had a look at the Maximum Resolution setting on the preset options, but can't really fathom how this applies to maximum zoom. I'll experiment some more, but I figured it might be useful to others if someone could document their knowledge of this issue.

Files: 
CommentFileSizeAuthor
#20 openlayers-goog_zoomlevel_max-7x-563470-20.patch715 bytesjeffschuler
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]
#19 ol-goog_zoomlevel-563470-19.patch576 bytesjeffschuler
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch ol-goog_zoomlevel-563470-19.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

Comments

phayes’s picture

Title:Increase max zoom» Increase max zoom. 2.0
Category:support» feature

There 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.

phayes’s picture

Title:Increase max zoom. 2.0» 2.x: Set min and max zoom in map array
zzolo’s picture

Version:6.x-1.x-dev» 6.x-2.x-dev
tmcw’s picture

Status:Active» Fixed

This 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.

looplog’s picture

great thanks, I'll check it out when I have a chance

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Sinan Erdem’s picture

Component:OpenLayers Preset UI» OpenLayers API
Status:Closed (fixed)» Active

Is 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.

tmcw’s picture

You 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?

Sinan Erdem’s picture

If 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)

tmcw’s picture

Component:OpenLayers API» OpenLayers UI
Status:Active» Fixed

Hey 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?

Sinan Erdem’s picture

Of course, thank you...

tmcw’s picture

Status:Fixed» Needs work

Per-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.

tmcw’s picture

Status:Needs work» Fixed

per-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.

Status:Fixed» Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

narongwit12’s picture

I 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

narongwit12’s picture

Status:Closed (fixed)» Active

Narongwit

ejohnson’s picture

Re: #15 Did you find a fix for this, that you could share? Thanks.

tmcw’s picture

Status:Active» Closed (works as designed)

Google 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.

jeffschuler’s picture

Status:Closed (works as designed)» Active
StatusFileSize
new576 bytes
FAILED: [[SimpleTest]]: [MySQL] Unable to apply patch ol-goog_zoomlevel-563470-19.patch. Unable to apply patch. See the log in the details link for more information.
[ View ]

I 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?

Maps on Google Maps have an integer "zoom level" which defines the resolution of the current view. Zoom levels between 0 (the lowest zoom level, in which the entire world can be seen on one map) to 21+ (down to individual buildings) are possible within the default roadmap maps view.
-- http://code.google.com/apis/maps/documentation/staticmaps/#Zoomlevels

Patch for 6.x-2.x-dev attached.

jeffschuler’s picture

Version:6.x-2.x-dev» 7.x-2.x-dev
Component:OpenLayers UI» OL API
Status:Active» Needs review
StatusFileSize
new715 bytes
PASSED: [[SimpleTest]]: [MySQL] 238 pass(es).
[ View ]

re-rolled for 7.x-2.x-dev

cesareaugusto’s picture

Will this patch merged into the main 7.x dev release?

Pol’s picture

Status:Needs review» Reviewed & tested by the community

This patch fix the problem.

@cesareaugusto: Help us to reduce the issues here and we'll release a new version.

Pol’s picture

Status:Reviewed & tested by the community» Closed (fixed)