Skip Navigation

[Resolved] How to limit the pop up width to screen width?

This thread is resolved. Here is a description of the problem and solution.

Problem: The popup windows for each marker on my map View are wider than the available map space. How can I limit the width of the infowindow popups to be contained within the map screen?

Solution: There's nothing built-in to Toolset that will accomplish this for you, but you can use custom CSS with media queries to apply styles to the infowindow popup. Examples:

@media screen and (max-width: 375px) {
  .gw-iw-style {
    width: 210px !important;
  }
}
 
@media screen and  (min-width: 376px) and (max-width: 450px) {
  .gw-iw-style {
    width: 300px !important;
  }
}

Relevant Documentation:
https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

This support ticket is created 6 years, 2 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by davelow 6 years, 2 months ago.

Assisted by: Christian Cox.

Author
Posts
#1134974
Screenshot 2018-10-26 at 19.08.53.png

Tell us what you are trying to do?
Building a business directory section for my website.

Is there any documentation that you are following?
https://toolset.com/documentation/user-guides/display-on-google-maps/displaying-markers-on-google-maps/

Is there a similar example that we can see?

pop-up works fine on regular screen, however, overruns display area on smaller screens. any way to limit its width to screen width?

What is the link to your site?
hidden link

#1135692

There's nothing built-in to Toolset Maps, but you can apply your own custom CSS to set a maximum width for InfoWindow popups at different screen resolutions. Something like this:

@media screen and (max-width: 375px) {
  .gw-iw-style {
    width: 210px !important;
  }
}

@media screen and  (min-width: 376px) and (max-width: 450px) {
  .gw-iw-style {
    width: 300px !important;
  }
}

There is a custom CSS panel just beneath a View's Loop editor where you can add custom code. You'll have to experiment to find the right combination of widths and screen resolutions. More information about media queries: https://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries

#1139492

.gm-style-iw
My issue is resolved now. Thank you!