Your search did not match any results.

Vector Map - Dynamic Viewport

This demo illustrates how to change the map's viewport. Use the drop-down menu under the map to choose a continent and change the visible area so that the chosen continent is displayed optimally.

To implement this functionality, call the viewport(viewportCoordinates) method every time the drop-down box value changes. You can also implement the onCenterChanged and onZoomFactorChanged functions to display the map center's coordinates and the current zoom factor in text boxes under the map.

Backend API

To show or hide the control bar, enable or disable the panVisible and zoomVisible properties. You can toggle switches under the map to see how these settings affect the control bar.