DevExtreme v24.2 is now available.

Explore our newest features/capabilities and share your thoughts with us.

Your search did not match any results.

React 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.

To give you the ability to edit code on the fly, the demo uses SystemJS. For this reason, launching the demo takes some time. We strongly recommend that you do not use this approach in real projects.
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.