Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

Map-Button quirkiness with user-created Map-Buttons

27 Jun 2023, 05:00

Hello, Karl,

Most-likely this quirkiness is caused by myself, trying to (yet again!) do the impossible to X3 that it was not designed for  :upside_down:.

99.9% of the map-buttons on my X3 sites are the default X3 map-buttons, but I have a few galleries that I am using my user-created map buttons, using code such as the following that you helped me with a few months ago:
Code
<button data-href="https://www.google.com/maps/embed/v1/?api=1&query=32.385892, -64.687253" data-embed-modal="https://www.google.com/maps/embed/v1/place?center=32.362464057636025, -64.68865929223722&q=32.36966427553307, -64.69140187529807&key=AIzaSyDRp6xla9SxUmTBu6l_kprhjjI9e5-EVZk&zoom=14&maptype=satellite" class="button small button-map" data-lang="map"></button>
The reason why I create these manual map-buttons, is so that I can center the maps & show the pins elsewhere on the map, and also to set the zoom-levels, and to have the map initially display in satellite view.  This has worked great for me for the past few months.  However, I've discovered some quirkiness using this method.

In the below gallery, most of the pictures so far have my manual map-buttons.  For now, I have left the X3 map-button enabled to illustrate the quirkiness, but eventually I will have the X3 map-button disabled (unchecked) in settings.

As an example, if you look at THIS image, notice the 2 map-buttons at the bottom in the popup.  The lower map-button is X3's default map-button, and the upper map-button is my manual map-button.

Normally, when a visitor hovers their mouse over the X3 map-button, a small Googlemap preview pops up in a small window.

However, when I create my manual map-button, AND with X3's map-button temporarily still enabled for now, that small Googlemap preview that pops up in a small window is now triggered by hovering the mouse over my manual map-button.  This is not a problem and is actually fantastic.

But as mentioned before, I will be disabling the X3 map-button entirely in the few galleries that I am using my manual map-button.  However, when I disable X3's map-button and leave just my manual map-button, that small Googlemap preview no longer pops up in a small window.

It seems that in order for me to have that small Googlemap preview pop up in a small window, I need to have X3's default map-button enabled, so for the few galleries that use my manual map-button, I will end up with 2 map-buttons if I wish to continue to utilize my manual map-buttons.

Can you think of a way that I can have X3's map-button disabled for those few galleries, but have the small Googlemap preview still pop up in a small window when users hover their mouse over my manual map-button?

If that's not possible, I'm OK with that, and I will just continue to use my manual map-button in those few galleries without any small Googlemap previews popping up.

Thanks in advance & have yourself a great day.

Regards,
John
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13998
Joined: 30 Sep 2006, 03:37

Re: Map-Button quirkiness with user-created Map-Buttons

27 Jun 2023, 21:33

The only way to achieve that, would be to keep X3's map button, and instead hide it via CSS. Something like this:
Code
.button.button-map-popup.small {
  display: none;
}
The hover-map appears as a result of the X3 map button enabled. It's really only a coincidence that it piggy-backs your own map button, because it has the same target classes as the native map button.
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

Re: Map-Button quirkiness with user-created Map-Buttons

27 Jun 2023, 23:25

That works perfectly.  Thank you, sir.  Have a great day.
Location: Burlington (Toronto-ish), Ontario, Canada
Self-hosted using Abyss Web Server:   AuroraWings.me   |   GalleryWings.com   |   PanAurora-Studio.com   |
Externally-hosted using LiteSpeed/Apache Web Server:   GenealogyWings.com/galleries   |