• Hey!

    Is there a way or actually possible to limit pins on the Google Map to one? Let’s say that i wrote an address into a input field, that will create a pin on a map, but then i realized that there’s a mistake, so i typed another address again, but that will add another pin instead of override / remove previous one. Also, there’s a default pin on a map despite checking my settings, so even after typing an address for the first time, there’s already a pin on a map.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Mahfuzul Alam

    (@mahfuz87)

    Hi @johnwandler

    Thank you for reaching out.

    There is just one pin in the map. If user type the address on the address field it will generate the pin on the map. This is the only way to create a location pin, it cannot be overwritten. There is no default saved pin on the map. The location is showing by default on the add listing page will not show on the single listing page.

    If you face any issue related to this please contact the support channel here – https://prnt.sc/cKSW-z2RTXrs. We will help you to solve this issue on your website if needed.

    Kind Regards

    Thread Starter johnwandler

    (@johnwandler)

    This is what i’m talking about. Steps to reproduce:

    1. Click “Add new listing”
    2. Type any location that you want
    3. Type another location, and another, and another, etc.

    Pins will eventually keep stacking. There’s a button “Remove pin/marker”, but you have to click that button before changing location. It won’t update (by update i mean old pin should be moved or removed automatically) after changing location.

    Is there a way to do that or it’s a Google Maps limitation?

    Temporary solution (not ideal):

    $(document).on('change', '#address', function() {
        $('#delete_marker').trigger('click')
    })

    You can limit to “Add / Edit listing” by changing to “#directorist-add-listing-form #address” and “#directorist-add-listing-form #delete_marker”. Also, you can modify event listener to “change input”, if you want to delete marker right after any input.

    • This reply was modified 8 months, 3 weeks ago by johnwandler.
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Limit pins to one when adding new listing’ is closed to new replies.