“Reset” Button

New home Forums Pro Add-on “Reset” Button

Tagged: 

  • This topic has 12 replies, 3 voices, and was last updated 3 months ago by AbelC.
Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #59770
    xyzbytes
    Participant

    Hello,
    I have a map with 2 custom filters. The locations display below the map as well. When I click on a location listed below the map, it shows the location on the map. When I hit “Reset”, I was expecting the map to reset to it’s original view – showing all locations. Is that the way it should work? If not, please advise on how to make it work that way.

    Also, my email provider marked your email as “spam/spoof” –
    This email has failed its domain’s authentication requirements. the sender’s email address failed one of the domain validation checks (SPF, DKIM, or DMARC)

    You guys should fix this – it is a simple fix.

    Thanks for your help!

    #59785
    AbelC
    Moderator

    Hi There,

    Thank you so much for getting in touch with us, and our sincere apologies for the inconvenience.

    1. Could I kindly ask if you could please provide me with a link to your map page as this will allow us to take a closer look at what is causing this issue?

    Would it also perhaps be possible to please provide us with a screenshot of the reset button you are referring to?

    I will then be able to advice further.

    2. I have now informed our accounts department and we will look into this issue as soon as possible. Thank you for letting us know, and we do apologize for the inconvenience.

    I look forward to hearing back from you and resolving this issue.

    Kind Regards,
    Abel

    #59787
    Nick Duncan
    Keymaster

    @xyzbytes Hi there. Thank you for the heads up – We have valid SPF, DKIM and DMARC checks in place. Can you please send me more information about why you say they are invalid?

    • This reply was modified 3 months, 1 week ago by Nick Duncan.
    • This reply was modified 3 months, 1 week ago by Nick Duncan.
    #59799
    xyzbytes
    Participant

    Hi Nick,
    I’m just relaying what my email provider is flagging email from your [email protected] Maybe it’s a false positive.

    Here is a tool for additional testing to verify.
    https://www.mail-tester.com/

    Thanks!

    #59800
    xyzbytes
    Participant
    This reply has been marked as private.
    #59803
    AbelC
    Moderator

    Hi There,

    Thank you so much for getting back to me.

    Unfortunately, this is not supported at the moment to reset the map to the start location when clicking on a marker listing item. We do apologize for the inconvenience.

    With that said, would you perhaps be open to receive Custom JS to add a button above the marker listing to reset the map to the map start location and zoom level?

    If so, could I kindly ask if you could please provide me with a link to your map page?

    I will then be able to prepare the code needed to achieve this and get back to you as soon as possible.

    I hope this helps clarify, and I look forward to hearing back from you.

    Kind Regards,
    Abel

    #59805
    xyzbytes
    Participant
    This reply has been marked as private.
    #59815
    AbelC
    Moderator

    Hi There,

    Thank you so much for your time on this one, and my sincere apologies for the delayed response over the weekend.

    Could I kindly ask if you could please navigate to Maps -> Settings -> Advanced -> Custom JS -> Please paste the following code below:

    jQuery(function($){
    
    var map = WPGMZA.maps[0];
    var reset_button = $('.wpgmza-reset-custom-fields').after('<button type="button" class="wpgmza-reset-marker-listing-location">Reset Location</button>');
    jQuery('body').on('click', reset_button, function(){
    var location = new WPGMZA.LatLng({
        lat: map.settings.map_start_lat,
        lng: map.settings.map_start_lng,
    }); 
    
     map.setCenter(location);
     var zoom = map.settings.map_start_zoom;
     map.setZoom(zoom);
    
      });
    });

    Once you have added the Custom JS code, could you please add the following Custom CSS:

    .wpgmza-reset-marker-listing-location {
        margin-left: 5px;
    }
    

    Please do let me know if you are happy with the changes made so far.

    I look forward to hearing back from you.

    Kind Regards,
    Abel

    #59838
    xyzbytes
    Participant
    This reply has been marked as private.
    #59846
    AbelC
    Moderator

    Hi There,

    Thank you so much for letting me know, and my sincere apologies for the mistake on my behalf.

    Could I kindly ask if you could please replace the previous Custom JS code provided with the following code below:

    jQuery(function($) {
    $(window).on("markersplaced.wpgmza", function(event) {
    
    var map = WPGMZA.maps[0];
    var start_lat = WPGMZA.maps[0].settings.map_start_lat;
    var start_lng = WPGMZA.maps[0].settings.map_start_lng;
    var reset_button = $('.wpgmza-reset-custom-fields').after('<button type="button" class="wpgmza-reset-marker-listing-location">Reset Location</button>');
    jQuery('body').on('click', '.wpgmza-reset-marker-listing-location', function(){
    
    var location = new WPGMZA.LatLng({
        lat: start_lat,
        lng: start_lng,
    });
    
     map.setCenter(location);
     var zoom = map.settings.map_start_zoom;
     map.setZoom(zoom);
    
      });
    });
    });

    Please do let me know if it is now working as intended?

    If this issue persists, would you perhaps be open to please submit a support ticket here -> https://www.wpgmaps.com/support/ -> and please provide us with a temporary admin account as this will allow us to take a closer look at what is causing this issue.

    I look forward to hearing back from you.

    Kind Regards,
    Abel

    #59856
    xyzbytes
    Participant
    This reply has been marked as private.
    #59871
    AbelC
    Moderator

    Hi There,

    Thank you for getting back to me.

    Could I kindly ask if you could please replace the previous code with the following Custom JS below:

    jQuery(function($) {
    $(window).on("markersplaced.wpgmza", function(event) {
    
    var map = WPGMZA.maps[0];
    var start_lat = WPGMZA.maps[0].settings.map_start_lat;
    var start_lng = WPGMZA.maps[0].settings.map_start_lng;
    var reset_button = $('.wpgmza-reset-custom-fields').after('<button type="button" class="wpgmza-reset-marker-listing-location">Reset Location</button>');
    jQuery('body').on('click', '.wpgmza-reset-marker-listing-location', function(){
    
    var location = new WPGMZA.LatLng({
        lat: start_lat,
        lng: start_lng,
    });
    
     map.setCenter(location);
     var zoom = map.settings.map_start_zoom;
     map.setZoom(zoom);
    map.closeAllInfoWindows();
      });
    });
    });

    This should now close the InfoWindow once you have clicked on the “reset Location” button.

    I look forward to hearing back from you.

    Kind Regards,
    Abel

    #59875
    xyzbytes
    Participant
    This reply has been marked as private.
    #59882
    AbelC
    Moderator

    Hi There,

    Thank you so much for getting back to me, and it is only a pleasure.

    Please note that no Custom CSS or JS will be lost when updating the plugin.

    I will definitely add it to the Feature Request items for our development team to have a look at. They will assess the request, and if approved they will add it to our plugin in the future.

    Thank you for your suggestion.

    Please do let me know if there is anything else that I can assist you with.

    I look forward to hearing back from you.

    Kind Regards,
    Abel

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