It is not particularly difficult if you find the corresponding previous answer .
You need to convert the center of the map to your world coordinates, find where the map should be centered to place the visible center where you want, and re-center the map using the real center.
The API will always center the map in the center of the viewport, so you need to be careful if you use map.getCenter() , since it will return the real center, not the visible center. I believe it would be possible to overload the API so that its getCenter() and setCenter() methods are replaced, but I did not.
The code is below. Online example . In this example, pressing the button shifts the center of the map (there is a road connection) down 100 pixels and left 200px.
function offsetCenter(latlng, offsetx, offsety) {
Andrew Leach May 19 '12 at 2:28 pm 2012-05-19 14:28
source share