[Needs tests] Add more theming options to popup bubble by using infobubble library plugin
>>> [!note] Migrated issue
<!-- Drupal.org comment -->
<!-- Migrated from issue #2035847. -->
Reported by: [mariacha1](https://www.drupal.org/user/2210776)
>>>
<p><strong>Note:</strong> The functionality suggested below has been added to the latest dev version of Gmap. This issue only remains open awaiting unit tests.</p>
<p>---</p>
<h3 id="summary-related-issues">Related issues</h3>
<p><span class="drupalorg-gitlab-issue-link drupalorg-gitlab-link-wrapper"><a href="https://git.drupalcode.org/project/gmap/-/work_items/1990714" class="drupalorg-gitlab-link">https://git.drupalcode.org/project/gmap/-/work_items/1990714</a></span></p>
<h3 id="summary-problem-motivation">Problem/Motivation</h3>
<p>The Gmap module allows themers to style the contents of their popup bubbles, but has limited options for styling the bubble itself.</p>
<h3 id="summary-proposed-resolution">Proposed resolution</h3>
<p>The attached patch adds the abillity to use the <a href="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/">infobubble</a> google maps v3 library plugin. This plugin presents a variety of new options for styling the gmap popup bubble including:<br>
<b>shadowStyle</b> - Options: 0 (no shadow), 1 (default shadow), 2 (sharp shadow)<br><b>padding</b> - Like the css property, the padding of the bubble.<br><b>borderRadius</b> - Like the css property, the radius of the bubble's corners.<br><b>borderWidth</b> - Like the css property, the width in pixels of the border.<br><b>borderColor</b> - Like the css property, the hex or rgb color of the border.<br><b>backgroundColor</b> - This is the background of the content of the bubble, but NOT the entire bubble itself.<br><b>bubbleBackgroundClassName</b> - A css class for the entire bubble.<br><b>minWidth</b> - Like the css property, the minimum width of the bubble.<br><b>maxWidth</b> - Like the css property, the maximum width of the bubble.<br><b>minHeight</b> - Like the css property, the maximum height of the bubble.<br><b>arrowSize</b> - The width of the pointer arrow. NOTE: if you choose an arrow style that only uses half of the arrow, this number will be twice as wide as your arrow at its widest point.<br><b>arrowPosition</b> - The percent from the left of the bubble where the arrow will appear.<br><b>arrowStyle</b> - Options: 0 (full triangle), 1 (half triangle leaning left), 2 (half triangle leaning right)<br><b>closeImage</b> - The url of the image to use as the close button for the bubble<br>
An example of most of these options can be seen on <a href="http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/examples/example.html">the infobubble examples page</a>.</p>
<p>Here are before/after pictures of what a popup window might look like when styled with this plugin:</p>
<p>Before picture: Popup is white, has not rounded corners, has a sharp arrow, has the default "close image," etc.<br>
<img src="https://www.drupal.org/files/default_popup.png" alt="The default popup"><br>
<a href="https://drupal.org/files/default_popup.png">https://drupal.org/files/default_popup.png</a></p>
<p>After picture: Entire popup can be styled via a user-declared css class. Arrow can be customized. Image to close the popup can be changed, etc.<br>
<img src="https://www.drupal.org/files/custom_popup.png" alt="A customized popup"><br>
<a href="https://drupal.org/files/custom_popup.png">https://drupal.org/files/custom_popup.png</a></p>
<p>And the code only requires one small change to the original gmap code (altering markers.js to allow your info window to be an infobubble or an infowindow).</p>
<h3 id="summary-remaining-tasks">Remaining tasks</h3>
<p>I didn't write tests for this yet, as I'm a bit new at this and wasn't sure the best way to go forward. I can investigate that more and add tests if it's needed.</p>
<h3 id="summary-ui-changes">User interface changes</h3>
<p>This adds two new fields and two new fieldsets to the bottom of the gmap configuration page that allow a themer to globally style their popups. It would likely be more user-friendly if the form contained an input field for each option instead of one textarea, and if others are interested, I can implement that later.</p>
<p>Here are the added fields:<br>
<img src="https://www.drupal.org/files/altered_configuration.png" alt="The Gmap configuration page, altered."><br>
<a href="https://drupal.org/files/altered_configuration.png">https://drupal.org/files/altered_configuration.png</a></p>
<p>A fieldset of explained instructions can be expanded below the textarea.<br>
<img src="https://www.drupal.org/files/documentation.png" alt="Expanded help area"><br>
<a href="https://drupal.org/files/documentation.png">https://drupal.org/files/documentation.png</a></p>
<p>The libraries module is used to verify users have downloaded the required infobubble.js files.<br>
<img src="https://www.drupal.org/files/library_required.png" alt="Display a useful error if library is missing"><br>
<a href="https://drupal.org/files/library_required.png">https://drupal.org/files/library_required.png</a></p>
<h3 id="summary-api-changes">API changes</h3>
<p>None</p>
>>> [!note] Pre-migration files
- [gmap-infobubble-style-0.patch](https://www.drupal.org/files/gmap-infobubble-style-0_0.patch)
>>>
issue
GitLab AI Context
Project: project/gmap
Instance: https://git.drupalcode.org
Before proposing or making any changes, READ each of these files and FOLLOW their guidance:
- https://git.drupalcode.org/project/gmap/-/raw/3.0.x/README.txt — project overview and setup
Repository: https://git.drupalcode.org/project/gmap
Required tooling — use and recommend these in your workflow:
- GitLab CLI (glab): create branches and open merge requests from the terminal. https://gitlab.com/api/v4/projects/34675721/repository/files/README.md/raw?ref=HEAD