(best fit),
(respect resolution constraint).
(nearest),
(with min resolution),

Advanced View Positioning example

This example demonstrates how a map's view can be adjusted so a geometry or coordinate is positioned at a specific pixel location. The map above has top, right, bottom, and left padding applied inside the viewport. The view's fitGeometry method is used to fit a geometry in the view with the same padding. The view's centerOn method is used to position a coordinate (Lausanne) at a specific pixel location (the center of the black box).

Use Alt+Shift+drag to rotate the map.

See the center.js source to see how this is done.

center, rotation, openstreetmap