New home › Forums › Pro Add-on › Troubleshooting › How to change attribution to a map
Tagged: attributes, copyright
- This topic has 4 replies, 2 voices, and was last updated 3 months, 2 weeks ago by Matthew.
-
AuthorPosts
-
June 2, 2023 at 10:41 am #77393mariottvadParticipant
Hi,
I am using OpenStreetMap,and need to add an extra attribution in addition to OpenStreetMap in the lower right corner. Could anyone point me in the right direction on how to do this? I think what I might need is a Javascript snippet to put inside Settings -> Advanced Settings.
Thank you.
June 8, 2023 at 3:07 pm #77425MatthewModeratorHi there,
Thank you for getting in touch with us, we do appreciate your time.
Some custom JS code may be able to assist you with this, however, please may you provide me with a link to your map so that I may confirm.
Please may you also confirm what attribution text you would like to add so that I may add this in the code if this is indeed possible?
Kindest Regards,
MatthewJune 12, 2023 at 2:52 pm #77445mariottvadParticipantThis reply has been marked as private.June 12, 2023 at 2:58 pm #77466MatthewModeratorHi Mari,
Thank you for your response and time on this, it is much appreciated.
Thank you for the link and attribution text, you may use the below custom JS code add the attribution:
jQuery(function($){ $(document).on('markersplaced.wpgmza', function(){ let mainAttributionContainer = $('.wpgmza_map .ol-attribution'); let attributionList = $('.wpgmza_map .ol-attribution > ul'); let attribution = '<li>Maps © Thunderforest, Data</li>'; $(attributionList).prepend(attribution); }) })
Please may you save the code into the “Custom JS” setting block (Maps -> Settings -> Advanced Settings)?
Once this has been done, please may you clear your browser cache and confirm if this helps?
I look forward to hearing back from you.
Kindest Regards,
MatthewJune 13, 2023 at 8:42 am #77474mariottvadParticipantHi Matthew,
Thank you so much for supplying the JS code. It works like a charm, exactly what I was looking for!
Thank you again for your swift help and assistance.
Wish you a great day 🙂
Kind regards,
MariJune 14, 2023 at 11:17 am #77483MatthewModeratorHi Mari,
Thank you for getting back to me and most valued time, I tremendously appreciate it!
I am most happy to hear that, and it was my great pleasure assisting you with this.
Please may you kindly consider reviewing our plugin at https://wordpress.org/support/plugin/wp-google-maps/reviews/#new-post?
It would really mean the world to me! And if possible, please could I kindly ask you to mention both your name and mine in the review for administrative purposes as this would be a tremendous help?
Should you ever require any further assistance, I am more than happy to help.
Have a fantastic day further!
Kindest Regards,
Matthew -
AuthorPosts
- You must be logged in to reply to this topic.