Ready event

The ready event happens just after the load event but waits until all the controls managed by the Map constructor are dealt with, some having an asynchronous logic to set up.

Since the ready event waits until all the basic controls are nicely positioned, it is safer to use ready than load if you plan to add other custom controls with the .addControl() method.

In this example, we will wait for the ready event to add the terrain control to the map.



Related examples

An extension of MapLibre GL JS