You should do:
var mapOptions = {
center: new google.maps.LatLng(-34.397, 150.644),
zoom: 8
};
handler = Gmaps.build('Google');
handler.buildMap( {provider: mapOptions, internal: {id: 'map'}}, function(){
//code to add overlays etc... here
});
Or:
handler = Gmaps.build('Google');
handler.buildMap( {internal: {id: 'map'}}, function(){
// handler.map is the proxy object created by the gem,
// where you can add your custom methods,
// like centerOn
handler.map.centerOn([-34.397, 150.644]);
// handler.getMap() is the google map object
// you can also access it with handler.map.getServiceObject()
handler.getMap().setZoom(8);
});
It's important to pass the id
of the div
where you want the map to appear.