How to change attribution to a map

New home Forums Pro Add-on Troubleshooting How to change attribution to a map

  • This topic has 4 replies, 2 voices, and was last updated 1 year ago by Matthew.
Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #77393
    mariottvad
    Participant

    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.

    #77425
    Matthew
    Moderator

    Hi 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,
    Matthew

    #77445
    mariottvad
    Participant
    This reply has been marked as private.
    #77466
    Matthew
    Moderator

    Hi 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,
    Matthew

    #77474
    mariottvad
    Participant

    Hi 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,
    Mari

    #77483
    Matthew
    Moderator

    Hi 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

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.