5

I have a Gmap that has to zoom in bit by bit. To achieve this I need the Google map zoom level to be formatted like this '4.001'. I tried doing this by simply add this value as zoom level but it doesn't work.

So my question is how to achieve a Google map zoom level using multiple numbers behind the decimal. Is it even possible? If not, how do I achieve the slowly precise zooming?

Thanks

4 Answers 4

6

According to the documentation, the zoom level corresponds to the number of tiles in which the Earth is divided:

zoom = 1 => tiles = 2^1 * 2^1 = 2 * 2 = 4 zoom = 2 => tiles = 2^2 * 2^2 = 4 * 4 = 16 zoom = 3 => tiles = 2^3 * 2^3 = 8 * 8 = 64 etc 

Increasing the zoom level by 1 doubles the level of detail. The zoom level is an integer value. It corresponds to the discrete value of the slider control on Google maps.

Sign up to request clarification or add additional context in comments.

7 Comments

So according to your explanation I should use the tile calculations to increase the zoom level with e.g. 0.01's? Do you have any examples of how to do this in php?
var zoomLevel = 4; zoomLevel is an integer. map.setZoom(zoomLevel); You cannot use e.g 4.5. You can increase zoomLevel in steps of 1 e.g. from 4 to 5.
Yes I understand, but how do I achieve something like 4.5? Through tiles??
Suppose you show your map at zoomLevel = 4. Now you want to increase a bit the zoom, say to 4.1. The message is: you cannot do that; you have to increase to 5. And if it is too detailed you need to keep the zoom at 4. There are no intermediate levels between 4 and 5.
Is there a way to increase zoom slowly? I understand it's not possible. But maybe by using tiles?? But I don't know how..
|
3

When you want a zoom level between 4 and 5 for example 4.2 or 4.3 the only way is to use a cluster algorithm because the map is subdivide by 4. Cluster means that when the tiles are so close together that's not anymore practical to show them. There is a for example marker manager that can calculate clusters but it's not applicable to the map because it doesn't make sense to subdivide by 6 or 7 tiles.

Comments

2

You can gradually CSS-zoom the map canvas from 1 to 2, perhaps also masking the surroundings with elements. Then in one call change the css-zoom back to 1 and decrease the maps-zoom by one. You will see that streets, names and lines zoom along during the zoom, which is an unwanted artefact, but it sure looks smoother than the maps' zoom.

A zoom of 4.5 could be achieved by setting the maps zoom to 4 and the CSS-zoom to 1.5.

If you don't like the lo-res result you could do the opposite: set the CSS-zoom to 0.5 and the maps-zoom to 5. Both wil have their pros and cons in terms of data-usage, pixel density, object sizes.

Comments

0

In the Chrome browser, a workaround is to alternate zooming between the GMaps + and - and using "Ctrl -" and "Ctrl +" on your keyboard. This latter zoom is within Chrome. Between the two methods you can get a more customized zoom level. One benefit from going back and forth is that you can optimize text size at the same time.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.