Hi,
I generate a map with Views. I don't see any setting that I can set the max. zoom level for that map. When I play with available layers, I 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...
If you have time, please check the map on this link: http://sofra.bilimternet.com/deneme
Comments
Comment #1
tmcw commentedThe OpenLayers module doesn't change the default settings of the Google Maps api, which is preset to have 19 zoom levels.
Comment #2
capuchin commentedI have installed openlayers 2 from cvs and can only get 15 zoom levels using the google satellite layer. Whereas using maps.google.com directly I get 19 levels of zoom.
I am using a map embedded using an input filter. I also noticed the same issue on Openlayers 1x. Using the openlayers_cck field.
Is the current zoom level stored in the openlayers object?
Comment #3
tmcw commentedIndeed, setting numZoomLevels to 20 on a Google Maps API map will increase the range.
Comment #4
capuchin commentedIs the numZoomlevels setting exposed in the UI? Couldn't find it in the preset settings. If not perhaps it would be a useful thing to define in a preset?
Comment #5
zzolo commentedComment #6
Sinan Erdem commentedHummm.. As suggested by tmcw on this post: http://drupal.org/node/563470#comment-2530914, I opened this issue for 1.x branch. If you don't have anything different in your mind, I am going to set the version to 1.x again...
Comment #7
zzolo commentedSorry, I just got confused and saw 2.x in the post, and was too quick on the draw.
Like tmcw says we are not changing the default behavior of OpenLayers. I just did some testing and a regular map with just a google map layer does only have 16 levels and does not get the details of maps.google.com. But it must be pointed out that maps.google.com is not the same as what google allows to use for their mapping api.
So, then looking at the openlayers google example, you can get further in:
http://openlayers.org/dev/examples/google.html
If you look at the source code, they are setting the maxZoomLevel to be 20 and 22. So I think the "19" default is not necessarily the number of actual zoom intervals.
So, to achieve this in 1.x, you can just create a new layer with the layer hook, amke it a Google layer type, then set maxZoomLevels in the options array and viola. Obviously, if you dont know what this means, then you should take a look at the advanced_help documentation that comes with the 1.x module, and also just looking at how the current google layer is create will give you a good idea.
Comment #8
zzolo commenteddamnit, i set to 2.x again.
Comment #9
tmcw commentedThis is fixed in the most recent revision of 2.x as well - you can create a new Google Maps layer via the UI and set the numZoomLevels variable.
Comment #11
tahiticlic commentedHi,
can you explain where one can set the max zoom level? I've the 2.x version installed, and no such parameter appears.
Comment #12
petsagouris commented@tahiticlic #11: You need to clone an existing Layer. This way you will be able to edit the Zoom Level setting to whatever is supported by the layer service provider. This took sometime for me to realize too, it isn't too obvious.
Comment #13
petsagouris commentedThis task is still active, the zoom levels for the Google layers are not optimal in the beta1 version, users of the module need to clone the layers and set the zoom levels appropriately.
A most basic change would involve a number edit in : openlayers\plugins\layer_types\openlayers_layer_type_google.inc @line 74 in the form of:
Of course if we were to fine tune this we should include a different zoom level for each layer. From the google-v3.js found in the Openlayer-2.11 examples we can see that the zoom levels for "Streets" and "Hybrid" layers can be set to "20" and the "Satellite" can be set to "22". The respective section in the Google Maps API documentation page claims:
Comment #14
tahiticlic commented@George Petsagourakis
yes, thanks, I've seen that, that's not the max level you can define but the number of levels, which indeed force the max level.
Comment #15
petsagouris commented@tahiticlic
Are you aware of the max levels for the layers?
Comment #16
tahiticlic commentedI'll check this.
Comment #17
zzolo commentedThe default Google layers that come with the module are at the default zoom level which is 20. You can very easily make a new Google layer in the UI (or clone one of the Google layers) and then set the zoom levels to whatever you want.