Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Tijmen Smit

    (@tijmensmit)

    If you’re familiar with PHP, then this filter will help you do what you want.

    Thread Starter georgberlin

    (@georgberlin)

    Thank you!
    I have no idea about PHP but I will try and learn.

    Best regards,
    Georg

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Just copy the code from usage section from the link that I posted, place it in the functions.php inside your theme folder, and try to change this

    $geocode_components['administrativeArea'] = 'Illinois';

    into this.

    $geocode_components['administrativeArea'] = 'Berlin';

    You do need to make sure the “Restrict the geocoding results to the selected map region?” option is enabled on the WPSL settings page, and in this case set to “Germany”.

    Thread Starter georgberlin

    (@georgberlin)

    THANK YOU!

    Thread Starter georgberlin

    (@georgberlin)

    Oh, no.
    The filter works great but now Google autocomplete stops working.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    That shouldn’t break it. I will take a look at what’s going on in the code tomorrow.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Sorry for the late response, I did replicate the issue. But haven’t really had time to figure out why it breaks.

    Thread Starter georgberlin

    (@georgberlin)

    Ok. Please keep me posted if you figure out how to fix it.

    As far as I see the Google autocomplete also does not work with the widget. But this is not caused by the filter. I guess there is no autocomplete for the widget at the moment?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    No, the widget doesn’t have autocomplete support at the moment.

    Thread Starter georgberlin

    (@georgberlin)

    Do you plan to add the Google autocomplete feature within the next 5 weeks?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Not at the moment, I’m first planning to finish work on the directory and statistics add-on before continuing working on the main WPSL plugin and improving the existing add-ons. I will also be going on a holiday for a few weeks, so other then support, very little work will happen.

    I did find the exact problem why autocomplete breaks.

    The way the normal search is limited to country x is by settings the componentRestrictions. This supports limiting it to a administrativeArea ( the city ).

    Those same values are used to limit the autocomplete results, but the componentRestrictions used with the autocomplete only support restricting it by country, and including more data ( like the administrativeArea ) clearly breaks it.

    I will release a fix for this soon.

    Plugin Author Tijmen Smit

    (@tijmensmit)

    What exact state / city are all your locations in?

    Thread Starter georgberlin

    (@georgberlin)

    Berlin

    Thread Starter georgberlin

    (@georgberlin)

    Do you have any news?

    Plugin Author Tijmen Smit

    (@tijmensmit)

    Sorry for not responding before, but what you want doesn’t seem to be possible after all with autocomplete.

    From the autocomplete documentation.

    componentRestrictions can be used to restrict results to specific groups. Currently, you can use componentRestrictions to filter by country.

    .

    I tested several other options, but just restricting the autocomplete results to cities never worked for me.

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘Map region: State or City’ is closed to new replies.