Display number of markers as a shortcode above a map

New home Forums Pro Add-on General queries Display number of markers as a shortcode above a map

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #23419

    Display number of markers as a shortcode above a map. I need to show the numbers of sites as a statement at the top of a map.

    Appreciated

    Bill

    #23440
    Dylan
    Moderator

    Hi Bill,

    Thank you so much for your time on this one.

    Unfortunately this is not possible by default. However I could assist you with adding some jQuery which will do this for you?

    As all most of our variables are JavaScript variables, I could write some JavaScript which would count the markers and display them in a predefined html element.

    Would you be open to this?

    #23468

    Hi Dylan,

    Sounds good, however I have to have some kind of a budget to pass on to the client first. Any idea?

    Thanks

    Bill

    #23490
    Dylan
    Moderator

    Hi Bill,

    As this would be a minor customization, this will be free of charge and will not require a quote from our side.

    Once you are ready to make the changes, please let me know and I would be more than happy to assist you with applying the changes.

    🙂

    #23516
    This reply has been marked as private.
    #23537
    Dylan
    Moderator
    This reply has been marked as private.
    #23572
    This reply has been marked as private.
    #23595
    Dylan
    Moderator
    This reply has been marked as private.
    #23596
    Dylan
    Moderator
    This reply has been marked as private.
    #23697
    This reply has been marked as private.
    #23733
    Dylan
    Moderator
    This reply has been marked as private.
    #23754

    // The Advanced Custom Fields are not working so it had to be posted in a code fragment in the
    // AVADA child Fusion builder
    // Works nicely – Thankyou very much.
    // NB note change of ‘load’ to ‘ready’
    //———————————————————————————————-
    <script>
    jQuery(function(){
    jQuery(window).ready(function(){

    for(var entry in wpgmaps_localize) { console.log(entry);
    if(typeof wpgmaps_localize_marker_data[wpgmaps_localize[entry][‘id’]] !== “undefined”){
    var i = 0;
    for(var marker in wpgmaps_localize_marker_data[wpgmaps_localize[entry][‘id’]]){
    i++;
    }
    jQuery(‘<span class=”map_counter”>Number of NowBaby hospitals: ‘ + i + “</span>”).insertBefore(“#wpgmza_map_” + wpgmaps_localize[entry][‘id’]);
    }
    }

    #23781
    Dylan
    Moderator

    Hi Bill,

    So glad to hear this worked for you. 🙂

    Please shout if you need anything else!

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