Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to "zoom in" one level with Google maps API V3?

I can't find an answer for that simple question anywhere! How on earth can we zoom in with one level (+1 from the current one) in google maps API V3?

I mean is there a function for that purpose? or a hack or whatever?

What I actually want to do is to zoom by one level onclick on a link located in a marker's infowindow and also the same result ondblclick on the marker but in both cases the zoom should increment only +1 at each event (click on link or dblclick on marker) and the zoom center should be the marker in question.

I'm open to any suggestion involving native Googlemaps methods, jQuery or plain Javascript.

Anyone who tickled the same problem?

like image 212
Sidou Avatar asked Feb 17 '12 07:02

Sidou


People also ask

How do I change the zoom level in Google Maps API?

Users can zoom the map by clicking the zoom controls. They can also zoom and pan by using two-finger movements on the map for touchscreen devices.

How do you zoom all the way in on Google Maps?

Zoom in the mapDouble tap a spot on the map, and then: Drag down to zoom in. Drag up to zoom out.

How do I zoom in with one finger on Google Maps?

Using one finger, you can double-tap on Google Maps and hold your finger down on the second tap. Then, all you have to do is slide your finger up and down, and the map will zoom in and out.

What is zoom level in Google map?

The Google Maps API provides map tiles at various zoom levels for map type imagery. Most roadmap imagery is available from zoom levels 0 to 18, for example. Satellite imagery varies more widely as this imagery is not generated, but directly photographed.


1 Answers

map.setCenter(marker.getPosition());    //marker is marker to center on
map.setZoom(map.getZoom() + 1);
like image 81
slawekwin Avatar answered Oct 20 '22 11:10

slawekwin