0

I have a map that shows the users location and automatically zooms in. I am wondering how I can set this zoom level as 'zoom' and 'maxZoom' isn't working. After some googling it seems that I need to set the bounds but wouldn't know where to start. I am hoping to get it to zoom to around 12.

Here is part of the code:

jQuery('#map_canvas').gmap('getCurrentPosition', function(position, status) { if ( status === 'OK' ) { var clientPosition = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); jQuery('#map_canvas').gmap('addMarker', {'position': clientPosition, 'bounds': true}); jQuery('#map_canvas').gmap('addShape', 'Circle', { 'strokeWeight': 0, 'fillColor': "#008595", 'fillOpacity': 0.25, 'center': clientPosition, 'radius': 15, 'clickable': false }); } }); 

1 Answer 1

2

use the setZoom-method of the google.maps.Map-instance to apply a custom zoom after adding the marker

jQuery('#map_canvas').gmap('get','map').setZoom(12); 
Sign up to request clarification or add additional context in comments.

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.