Open google map marker info window

Nowadays we use Google map API v3 for using google map in our page. Google gives us full API documentation to use this and to open google map marker info window but sometimes we get stuck in some specific requirements.

In google map, we point the specific location based on it’s longitude and latitude and create a marker on that point. But If we want to show some information about that point, then we need to attach an info window with that marker which can be associated with marker’s hover or click event.

Open google map marker info window

We need to open info window of the marker by using javascript/jQuery code. It’s very simple and just use below given code in script tag:

In the first three lines we are getting latitude and longitude of a specific marker to get the center point of that marker in the map. In fourth line, we are triggering the click event of that specific marker using javascript and at last in fifth line, We are centering the map position.

And that’s all the easy code to open google map marker info window.

You Might Interested In

Leave a Reply

Enclose a code block like: <pre><code>Your Code Snippet</code></pre>.