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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T19:20:47+00:00 2026-06-06T19:20:47+00:00

I made a Google Map in which I customize the InfoWindows using the InfoBox

  • 0

I made a Google Map in which I customize the InfoWindows using the InfoBox library.
I am however struggling to make some InfoWindows wider than others. This can be seen in a demo map.

var w = "530px";
if(!foto){
w= "200px";
}

var myOptions = {
maxWidth: 0
,boxStyle: { background: "url('tipbox.gif') no-repeat", width: w }
,closeBoxMargin: "10px 2px 2px 2px"
};
infoWindow = new InfoBox(myOptions);

Debugging the demo I see that w gets set correctly:

enter image description here
enter image description here

Yet, both InfoWindows have the same width.

  • 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-06T19:20:48+00:00Added an answer on June 6, 2026 at 7:20 pm

    When the marker click listener runs, you change the content of the infoBox (setContent(boxText)), but not the size. Replace the setContent call with setOptions(myOptions), that will change everything, including the boxText.

    google.maps.event.addListener(marker, "click", function(){
      if(map.getZoom() < 6) map.setZoom(6);
    
      map.panTo(marker.getPosition());
      infoWindow.setOptions(myOptions);
      infoWindow.open(map, marker);
    });
    

    BTW – indenting your code in a reasonable manner would make it easier to understand.

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

Sidebar

Related Questions

I have made my own map using the google maps api. It is a
I've made a very simple app that just displays a Google map. However, it
I have made the same Google map web page with more than two destination
I have a ASP.NET website which contains a Google Map. I am using the
Using Google Apps Script, I've made a UI for use on a Google Spreadsheet.
I'm using a Google Analytics API Class in PHP made by Doug Tan to
im trying to parse the XML returned by Google contacts API i made some
Is pinch zoom functionality in Google map is possible, i have made several search
I've been working with Google Maps API v3 and created a map which allows
I made a few Polygons on a Google map. Now I want to add

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.