Addon Open Street Map shows icon on wrong position - Forum | JoomShaper
Solved General

Addon Open Street Map shows icon on wrong position

Asked by Juergen Baisch 4 years ago Last activity 1 year ago

Hi,

Further down this page is the Open Street Map addon.
https://water-for-africa.org/en/fields-of-activity.html
Since Joomla 4 or the upgrade of the Helix Framework to 3.0.2, self-made icons like the taps no longer appear in the right position.

I have added a default marker for comparision. It is in the right position.

The self-created icons only approach the true position when you zoom in strongly.
Comparison: the map shows that we have projects in South Sudan. This is wrong.

Thanks for your help.

Juergen

Accepted answer

Marked as the solution
Mehtaz Afsana Borsha Staff

Thanks all for your opinions and suggestions and solutions. I will note it down in our list.You can now close this post by accepting the answer.

Thanks.

9 more replies

Mehtaz Afsana Borsha Staff

Hi

Apology for your experience with our product. Could you please give me that specific page linka and also screenshot? So that I can check.

-Regards.

Juergen Baisch Asked this

Hi,

In the post https://www.joomshaper.com/forum/question/12923#qa-answer-62802 I pointed out that the icons are displayed distorted. Your colleague suggested the CSS code shown in the post.
The icons no longer appear distorted, but in the wrong place.
See:
https://prnt.sc/kPYTTo9jgAqo
https://water-for-africa.org/en/fields-of-activity.html (at the bottom of the page)

Since our website is trilingual, it also has 3 templates.
In the German template I have now deleted the CSS code of your colleague from the post https://www.joomshaper.com/forum/question/12923#qa-answer-62802.
The icons now appear distorted, but in the right place:
https://prnt.sc/amBpPgFbat-J
https://water-for-africa.org/de/arbeitsfelder.html (at the bottom of the page)

Probably the CSS code of the post https://www.joomshaper.com/forum/question/12923#qa-answer-62802 must be adapted. Anyway.

Thanks a lot.

Juergen

conshelf

Hello,

Just to confirm, I have the same exact issue as Juergen.

The CSS below does fix the icon size, but as Juergen said, they now appear in the wrong place on the map.

.leaflet-marker-icon {
    height: auto !important;
}

Kind regards,
John

conshelf

Hello,

It looks like the inline styles are causing the issue. There's an inline style for height that is 95px, if that is changed to match the 38px width, then the issue is resolved.

<img src="/images/markers/pins/style4/map-icon.png" class="leaflet-marker-icon leaflet-zoom-animated leaflet-interactive" alt="" tabindex="0" style="margin-left: -22px; margin-top: -94px; width: 38px; height: 95px; transform: translate3d(1025px, 341px, 0px); z-index: 341;">

However, I'm not sure what is injecting the the height and width for the icons.

Kind regards,
John

conshelf

Ok, this would not be the recommended solution since it's modifying a core SP Page Buider JS file, but it gets the job done if you are looking for an immediate solution.

Need edit this file components/com_sppagebuilder/assets/js/leaflet-provider.js (file is minified, so you'll need to look for this line:

{for(var c=L.Icon.extend({options:{iconSize:[38,95],iconAnchor:[22,94]

And change the 95 to 38 and the 94 to 37.

Hopefully, Joomshaper has a more permenant fix coming. Just thought I'd share what I did to get the page looking nice while we wait.

Kind regards,
John

Juergen Baisch Asked this

@conshelf: Your code works :-)

@Joomshaper support: please update your file as conshelf has suugested. Otherwise we have to change the file after every SP PageBuilder Update. That is not a good solution. Thanks.

conshelf

Hello,

Just updated the latest version of SP Page Builder and the map issue still exists.

This really needs to be addressed.

Kind regards,
John

digitalconnect

Wy after all these years this si still not fixed??

Mehtaz Afsana Borsha Staff

Hi

Sorry for this inconvenience. Could you please create a new forum post about your issue?

Log in to reply.