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 8884555
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T21:05:18+00:00 2026-06-14T21:05:18+00:00

In order to get custom info window, I am working with the InfoBox plug-in

  • 0

In order to get custom info window, I am working with the InfoBox plug-in for google maps API V3 for the first time. I have the infoboxes with google places API content opening on click. But when I click a new marker the previous info box does not close. I only want one infobox open at a time. I attempted to follow the guidance in this questions: Google Map V3 – Allow only one infobox to be displayed at a time in my own code. Here is the relevant section of my code:

 var boxText = document.createElement("div");
 boxText.style.cssText = "border: 1px solid black; margin-top: 8px; background: yellow; padding: 5px;";


 var myOptions = {
             content: boxText
            ,disableAutoPan: false
            ,maxWidth: 0
            ,pixelOffset: new google.maps.Size(-140, 0)
            ,zIndex: null
            ,boxStyle: { 
              background: "url('') no-repeat"
              ,opacity: 0.75
              ,width: "280px"
             }
            ,closeBoxMargin: "10px 2px 2px 2px"
            ,closeBoxURL: "http://www.google.com/intl/en_us/mapfiles/close.gif"
            ,infoBoxClearance: new google.maps.Size(1, 1)
            ,isHidden: false
            ,pane: "floatPane"
            ,enableEventPropagation: false
    };

 var ib = new InfoBox(myOptions);
  var request =  {
      reference: place.reference
};
google.maps.event.addListener(marker,'click',function(e){
    service.getDetails(request, function(place, status) {

      if (status == google.maps.places.PlacesServiceStatus.OK) {
        boxText.innerHTML = '<br><div><div style="font-size: 18px; vertical-align:top; border:2px solid; background-color:; color: #555555;"><b>&nbsp;'+place.name+'</b>';
        if (!!place.website) contentStr += '&nbsp;<a target="_blank" href="'+place.website+'"><img src="img/arrow.png" style="position:absolute; bottom:0px: right:0px; height:22px; width:22px;"></img></a></div></div>';
        ib.close(); 
        ib.open(map, marker); 
      } else { 
        var contentStr = "<h5>No Result, status="+status+"</h5>";
        ib.close(); 
        ib.open(map, marker); 
       }
    });

});
gmarkers.push(marker);

Unfortunately I still have more than one infowindow at a time. Also is there another option to style the google API info window that does not require loading another script? This is going to run on a mobile website and if there is a way to only use CSS3 that would be preferable.

  • 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-06-14T21:05:20+00:00Added an answer on June 14, 2026 at 9:05 pm

    I solved the problem using this example http://www.geocodezip.com/fredagsmat_se_infoboxA.html which was picked up from this forum post https://groups.google.com/forum/?fromgroups=#!topic/google-maps-js-api-v3/gLHyTaKlJ2c.

    If I understand correctly, you need to make your infobox variable global by placing it outside of the initialize function. In my case var ib = null;. Then you place ib = new InfoBox({}); right before the close of your initialize function. How you call the function will depend on your particular javascript but just refer to the example for some guidance.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have custom controller that knows order id, is it possible to get order
I have the following models but I cannot get the custom method reorder_action_items to
I have a type: public class IssueForm { Order Order {get; set;} Item Item
I have been following this tutorial in order to get username authentication with transport
In order to get my setup a bit closer to one click deployment, I
In order to get better SEO and cleaner URLs, I tend to export certain
In order to get the next element in the list one just needs to
I'm attempting to get order data from a Yahoo store. I'm using the docs
What exactly needs to happen in order to get detailed SQL logs out of
I am using saxparser in order to get xml tag contents from file. All

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.