In this article I will explain how to open (show) InfoWindow without using Markers on Google Map in Google Maps API V3 and JavaScript.
 
Open (Show) InfoWindow without using Markers on Google Map
The following code snippet displays the Google Map of India inside the window.onload event handler. After the Google Map is loaded a click event listener has been assigned to the Google Map.
Inside the click event listener, the geographical coordinates i.e. the Latitude and Longitude of the location that was clicked is determined and is set as content of the InfoWindow.
Finally InfoWindow is opened and shown on the Google Map.
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script type="text/javascript">
    window.onload = function () {
        var mapOptions = {
            center: new google.maps.LatLng(21.0000, 78.0000),
            zoom: 5,
            mapTypeId: google.maps.MapTypeId.ROADMAP
        };
        var map = new google.maps.Map(document.getElementById("dvMap"), mapOptions);
 
        //Create InfoWindow.
        var infoWindow = new google.maps.InfoWindow();
 
        //Attach click event handler to the map.
        google.maps.event.addListener(map, 'click', function (e) {
 
            //Determine the location where the user has clicked.
            var location = e.latLng;
 
            //Set Content of InfoWindow.
            infoWindow.setContent('Latitude: ' + location.lat() + '<br />Longitude: ' + location.lng());
 
            //Set Position of InfoWindow.
            infoWindow.setPosition(location);
 
            //Open InfoWindow.
            infoWindow.open(map);
        });
    };
</script>
<div id="dvMap" style="width: 500px; height: 500px">
</div>
 
 
Screenshot
Google Maps API V3: Open (Show) InfoWindow without using Markers on Google Map
 
 
Demo
 
 
Downloads
Download Code