One of the most important aspects of using maps is user interaction. Interacting with the map can be done in various ways, which also depends on the device used; for example, you can hover over a location using the mouse, but you can't do this using a touch-based device, such as a smartphone. In smartphones, you can use multitap or perform gestures, and these user interactions cannot be performed using the mouse.
In this recipe, you will learn how to use event listeners to trigger actions in order to implement user interaction in your map.
The condensed steps to be performed are as follows:
Let's perform these steps now:
Start by opening the starter project directory...