Your search did not match any results.
Vector Map

Dynamic Viewport


This demo illustrates how to change the map’s viewport from code. Choose a continent using the drop-down menu under the map. In response to that, the map changes the visible area so that the chosen continent is displayed optimally. This is performed in code by calling the viewport(viewportCoordinates) method. After that, callback functions assigned to the centerChanged and zoomFactorChanged options are triggered. These functions place the current values of the map’s center and zoom factor in the text boxes under the map.

The source code for the React version of this demo will be available soon.