diff --git a/examples/center.html b/examples/center.html new file mode 100644 index 0000000000..20eff037c4 --- /dev/null +++ b/examples/center.html @@ -0,0 +1,135 @@ + + +
+ + + + + + + + +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.
+