Forum: Global Maps

This forum is closed for new topics. However, you can still search for a solution in the old topics. For technical support related to the Global Maps premium extension please open a new premium support ticket.

[Resolved]Directions and icons

Forums Global Maps Directions and icons

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #50153
    Chris Homan
    Member

    Hi Eyal,

    A few tidbits left for me to do that I struggle with. Maybe you have an idea:
    1) In the popup window directions, the directions are only shown after clicking on one of the options. I’d prefer it if they show when the window opens
    2) I don’t seem to be able to set custom markers for the starting and endpoint markers for the directions (with A and B)?
    3) Can I restrict the bouncing of the selected marker? Either restrict the number of bounces or restrict the bounce height.

    Any thoughts?

    #50221

    Hi Chris,
    Unfortunately, there is no easy fix for any of the above. 1 and 2 will require code customization and 3 I am not sure is possible. I don’t it is possible to restrict the number of bouncing nor the height. It is possible to stop the bouncing after few seconds for example but that will also require a work around.

    I am sorry I cannot provide you with a “quick fix” this time.

    #50228
    Chris Homan
    Member

    Ok, I’ll work around it 🙂

    #50311
    Chris Homan
    Member

    Managed to create a workaround:

    I included a button in my popup window that when clicked, calculates and shows the directions. When clicked again, it hides the directions.

    In my functions.php:

    add_action('gmaps_gmpt_iw_template_before_live_directions', 'insert_diections_button');
    function insert_diections_button() {
    ?>
    <button class="get-directions-button show">show directions</button>
    <?php
    }

    In my custom javascript file:

    $(document).on('click', '.get-directions-button', function(e) {
    if ($(this).hasClass('show')) {
    e.preventDefault();
    formId = $(this).siblings('.gmw-get-directions-wrapper').find('.gmw-directions-form-id').val();
    gmwFormId = $(this).siblings('.gmw-get-directions-wrapper').find('.gmw-form-id').val();
    gmwCalcRoute( gmwFormId, formId );
    $(this).html('hide directions').toggleClass('show');
    $(this).siblings('.gmw-get-directions-wrapper').show();
    $(this).siblings('.directions-panel-wrapper').show();
    }
    else
    {
    $(this).html('show directions').toggleClass('show');
    $(this).siblings('.gmw-get-directions-wrapper').hide();
    $(this).siblings('.directions-panel-wrapper').hide();
    directionsDisplay.setMap(null);
    }
    });

    And finally, in my css:

    It might be of help to others 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.