Sideshow
Sideshow

Reputation: 1361

Google Maps V3 Zoom Settings

I am using the following code to drag in google maps with a single marker:

$('#mapx').gmap({'callback':function(){
    var self=this;
    var scope=latitude+','+longitude;
    self.addMarker({'position':scope, 'bounds':true}).click(function(){
        self.openInfoWindow({'content': 'Hello World'),this);
    });
}});

which is working fine although the map appears at the maximum zoom size. I have tried various methods from the documentation to set the zoom but can not get anything to work with this code.

$('#mapx').gmap({'option', 'zoom', 7});

The above does not seem to work but I think this may be the location of this line in my code.

Upvotes: 0

Views: 142

Answers (2)

Dr.Molle
Dr.Molle

Reputation: 117354

remove 'bounds':true from the options passed to addMarker.

Upvotes: 1

Andrey
Andrey

Reputation: 60105

Try this:$('#map_canvas').gmap('option', 'zoom', 7);, there are no curly brackets.

Upvotes: 0

Related Questions