Possible Duplicate:
Is it possible to center a map at a fixed position (lat lng) – 100px?
This is my code :
var latlng = new google.maps.LatLng(42.745334,12.738430);
var options = { zoom: 12, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP };
var map = new google.maps.Map(document.getElementById('map'), options);
var marker = new google.maps.Marker({ position: latlng, map: map, title: 'Example' });
var infoWindow = new google.maps.InfoWindow();
var window_content = '<div style="width:110px;height:150px;">Test</div>';
infoWindow.setContent(window_content);
infoWindow.open(map, marker);
As you can see the map is centered by “position Marker”, not by InfoWindow height.
I need to have in the center of the map the center of the infowindow, in less words.
How can I do it?
P.S. I want to avoid the workaround to put an “high margin-top” at the infowindow…
you have to actually recenter the marker, not the infowindow.
did you manage to see the marker on the last example i gave you?
if so, when you drag it, you will see that the marker is re-centered with the infowindow.
here i added your infowindow html to it: http://jsfiddle.net/RASG/vA4eQ/10/
and here a 250 px high infowindow
EDIT
here is the last part of your code updated:
test it here: http://jsfiddle.net/RASG/VFqm5/1/