Search…

X3 Photo Gallery Support Forums

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

X3 is "converting" a Google Map parameter instead of using it as a parameter

15 Apr 2023, 18:20

Hello again, Karl,

I am having a problem with Settings|Content, in that X3 is changing my code when I click Save.

On THIS page, I have manually added a Map Button directly below the top image that's defined in Settings|Content.

I have defined that Map Button with the following code, and please note that I do NOT have the items on separate lines on my site... I have pasted the code here on separate lines only for clarity for you to see what I have:
Code
<button data-href="https://www.google.com/maps/embed/v1/?api=1&query=49.713237654196405,-124.90137968340973" data-embed-modal="https://www.google.com/maps/embed/v1/place?q=49.713237654196405,-124.90137968340973
&key=AIzaSyDRp6xla9SxUmTBu6l_kprhjjI9e5-EVZk
&zoom=15
&maptype=satellite"
class="button small button-map" data-lang="map"></button>
The above code works fine, however, when I add another option, when I click Save, X3 is corrupting my code.  I am trying to add a 4th parameter as follows:
Code
&key=AIzaSyDRp6xla9SxUmTBu6l_kprhjjI9e5-EVZk
&zoom=15
&maptype=satellite
&center=49.70064490823049,-124.93261425183724"
That &center parameter is supposed to center the map on the page, instead of the page being centered on the position marker, as shown HERE.

However, when I enter in that &center=49.70064490823049,-124.93261425183724 parameter & then click on Save, X3 saves it as ¢er=49.70064490823049,-124.93261425183724, so what I end up with is:
Code
<button data-href="https://www.google.com/maps/embed/v1/?api=1&query=49.713237654196405,-124.90137968340973" data-embed-modal="https://www.google.com/maps/embed/v1/place?q=49.713237654196405,-124.90137968340973
&key=AIzaSyDRp6xla9SxUmTBu6l_kprhjjI9e5-EVZk
&zoom=15
&maptype=satellite
¢er=49.70064490823049,-124.93261425183724"
class="button small button-map" data-lang="map"></button>
X3 is converting the first 5 characters of the &center parameter to the ¢ (cent) symbol :thinking:.

Am I able to get around this problem somehow, perhaps by using Custom CSS or something else?  Any suggestions for a remedy would be greatly appreciated.

Thank you in advance & have yourself a great weekend, sir.

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: 13993
Joined: 30 Sep 2006, 03:37

Re: X3 is "converting" a Google Map parameter instead of using it as a parameter

15 Apr 2023, 23:52

This is caused by the unfortunate circumstance that &cent (from your &center parameter) is a shortcut for the ¢ character in html, just like &copy is a shortcut for :copyright:. It's a bit clumsy, but the simple solution is to put "center=" as the first parameter in the url, thus avoiding having to start with the &amp character.
Code
https://www.google.com/maps/embed/v1/place?center=49.70064490823049,-124.93261425183724&...
As you can see in the above, by placing this parameter first, it starts with ? instead of &, and does not get converted. Place all the other params after this of course.
 
User avatar
JMM
Experienced
Topic Author
Posts: 154
Joined: 02 Aug 2021, 11:18

Re: X3 is "converting" a Google Map parameter instead of using it as a parameter

16 Apr 2023, 00:02

Perfect  :slight_smile:.

As always, thank you yet again for coming up with a solution for me.

Enjoy the rest of your weekend, sir.
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   |