User location button on front end

New home Forums Feature Requests User location button on front end

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #77180
    pop
    Participant

    If possible, would you consider having a button on the page in the future to indicate if the user wants to use location or not?

    I would really like this feature, thank you!

    #77236
    Matthew
    Moderator

    Hi there,

    Thank you for getting in touch with us, we do appreciate your time.

    Please may you confirm if the button should allow the plugin to access the user’s location, or if it should allow the user’s location to be found and entered into an input field?

    We look forward to your response.

    Kindest Regards,
    Matthew

    #77454
    pop
    Participant

    Sorry for the delay in replying. I’m glad you responded.

    What I’m hoping for is to have a button placed above the map that, when clicked, would trigger the browser to request the user’s location and subsequently use it like it already does today.

    The reason is that I noticed on a few different devices that the automatic browser location request prompt doesn’t always show up, even if I’ve fully cleared my browser’s cache.

    I also think that some users would be nervous about automatically sharing location and would leave my website. I think they’d be more comfortable if they could click a button to get this prompt instead.

    Please consider this.

    #77455
    pop
    Participant
    This reply has been marked as private.
    #77468
    Matthew
    Moderator

    Hi there,

    Thank you for your response and confirmation.

    Yes that is understandable and thank you for your screenshot, I have added this to our feature request list so that we may look into this in the future.

    We hope this helps?

    Kindest Regards,
    Matthew

    #77472
    pop
    Participant

    Thanks for your response.

    if I get the user’s location myself, is there a way I can send those location coordinates to the map plugin via JavaScript or some other way?

    Thank you again for your time. Looking forward to your response.

    #77481
    Matthew
    Moderator

    Hi there,

    Thank you for your response.

    Yes that is possible indeed, with the below custom JS code:

    jQuery(function($){
      let map = WPGMZA.maps[0];
    
      // Assign the lat/lng coords to the below respective variables
      let customLat = 0;
      let customLng = 0;
      
      let latlng = new WPGMZA.LatLng({
        lat: customLat,
        lng: customLng
      });
    
      map.setCenter(latlng);
      map.setZoom(14);
    })

    You may use the above code by assigning the respective coordinates to the customLat and customLng variables, in which it will then center the map on those coordinates and zoom into that location.

    I hope this helps?

    Kindest Regards,
    Matthew

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