# Google Maps: How to expand location panel on mobile

**URL:** <https://community.elfsight.com/t/google-maps-how-to-expand-location-panel-on-mobile/28959>\
**Category:** Pro Tips\
**Tags:** google-maps\
**Created:** [December 6, 2023, 2:52pm UTC](https://community.elfsight.com/t/google-maps-how-to-expand-location-panel-on-mobile/28959 "2023-12-06T14:52:50Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [December 6, 2023, 2:52pm UTC](https://community.elfsight.com/t/google-maps-how-to-expand-location-panel-on-mobile/28959/1 "2023-12-06T14:52:50Z")

</div>

By default, the location panel in [Google Maps](https://elfsight.com/google-maps-widget/) is collapsed on mobile, showing only 1 location from the list:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/elfsight/original/2X/2/2151ce8d515f46ed81dc63f1bed8efe1aadfc049.jpeg)

  

However, if you prefer to have it expanded right from the start, just add this script right after your widget installation code and you’ll be good:

```auto
<script>
  const waitForElement = (selector, callback, step, limit) => {
    const currentStep = step || 300;
    const currentLimit = limit || 5000;
    let remainingTime = currentLimit;
    const intervalId = setInterval(function () {
      const targetElement = document.querySelector(selector);
      if (targetElement || remainingTime <= 0) {
        clearInterval(intervalId);
        if (targetElement && typeof callback === "function") {
          callback(targetElement);
        }
        return;
      }
      remainingTime -= currentStep;
    }, currentStep);
  };

  waitForElement(".eapps-google-maps-map-container", (block) => {
    const widgetBlock = block.closest("[class*='elfsight-app']");
    const isOpened = widgetBlock.classList.contains(
      "eapps-google-maps-bar-opened"
    );

    if (!isOpened) {
      widgetBlock.classList.add("eapps-google-maps-bar-opened");
    }
  });
</script>

```

  

Got any issues or questions? Describe your use case in the comments and we’ll be happy to help 😉

---

<div class="post-metadata">

**Author:** ![Max](https://sea2.discourse-cdn.com/flex020/user_avatar/community.elfsight.com/max/32/710_2.png) [@Max](https://community.elfsight.com/u/Max)\
**Post date:** [September 3, 2024, 2:42pm UTC](https://community.elfsight.com/t/google-maps-how-to-expand-location-panel-on-mobile/28959/4 "2024-09-03T14:42:11Z")

</div>

5 posts were split to a new topic: [Code to expand location panel on mobile for Google Maps doesn’t work](https://community.elfsight.com/t/code-to-expand-location-panel-on-mobile-for-google-maps-doesnt-work/68784)
