Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7023071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T23:39:51+00:00 2026-05-27T23:39:51+00:00

I am using google map api v3 with js and I am trying to

  • 0

I am using google map api v3 with js and I am trying to to open infowndow on each marker on the map but through my code it is not opening here is my code sample please check it and tell me where is the error

  <script type="text/javascript">
 var map;

 var markers = new Array();

 function initialize() {
    var map_center = new google.maps.LatLng(31.2330555556,72.3330555556);


var GPS = <%=GPS %>
     var myOptions = {
      zoom: 8,
      scaleControl:true,
      pancontrol: true,
      streetViewControl: true,
      center: map_center,
      mapTypeControl: true,
      mapTypeControlOptions: {
      style: google.maps.MapTypeControlStyle.DROPDOWN_MENU
    },
      mapTypeId: google.maps.MapTypeId.HYBRID
    }    
    map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
    var infowindow = new google.maps.InfoWindow();


    for(i=0; i<GPS.length; i++)
    {

          var image = 'ico/no.png';

          var ContentString = GPS[i].TITLE;
          markers[i] = new google.maps.Marker(
          { 
           position: GPS[i].GPS,
           map: map,
           draggable:true,
           icon:image,
           title:GPS[i].TITLE
           });                      

            google.maps.event.addListener(markers[i], 'click', function() {
            infowindow.setContent(ContentString);
            infowindow.open(map,markers[i]);
            });             
         }    
      }
</script>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T23:39:52+00:00Added an answer on May 27, 2026 at 11:39 pm

    Try the following code:

    google.maps.event.addListener(markers[i], 'click', function() { 
                infowindow.setContent(ContentString); 
                infowindow.open(map,this); 
                }); 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the Google Maps API to build a map full of markers, but
I am using Google map local search API and I'm trying to search and
I'm using the Google Maps API V3 and I'm trying to make a marker
I'm trying to create map (using the Google Maps JavaScript API V3 ) which
I'm trying to extract some extra information from a location using google map api.
I'm creating a dynamic map using Google's API. I'm trying to get the map
I'm trying to update a Google Map (API V3) with markers using my friends
I have a scenario where I am using Google Map JavaScript API to process
Is it possible to do a google map lookup using the google maps API
I'm using the Google Maps API v2. I add markers to the map and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.