Get current map in event handler of marker click or position changed

Sometimes, we need to used map to get its current zoom level or center coordinates in event handlers. We can easily use map variable which we have created to show map through google map javascript api, but problem occurs when there are multiple map presents on the page, then in event handler we cannot use just map variable, to identify that  the event handler is fired for which map, so we need to use extra function to get map in event handler of google map javascript api.

Google Map API has a function get(‘map’) which can be used to get current map. I have shown here two examples below which shows how to use this function : Keep on reading