WPRentals Theme Documentation WPRentals Theme Documentation

  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API
Home / Advanced Search, WP Rentals Theme Options / How to manage the listing location with Google Places or OpenStreet Places

How to manage the listing location with Google Places or OpenStreet Places

6183 views
How to manage listing location with Google Places or OpenStreet Places in WPRentals. Watch Video on Youtube

WPRentals offers several ways to manage listing locations in the submit form and search forms.

The available location systems are:

  1. Google Places or OpenStreet Places autocomplete
  2. Theme auto-save location based on saved listing location details
  3. Dropdown selector for city and area

This help explains how to use Google Places or OpenStreet Places autocomplete for listing location and search.

Important: If you use Google Places, you must add a valid Google Maps API key and enable the Places API/library for that key. If you use OpenStreet Places, make sure OpenStreetMaps is selected as the map system.
Important: Use the same location system for adding listings and searching listings. For example, if listings are saved with Google Places autocomplete, visitors should also search with the Google Places location field.

CONTENT

  • How autocomplete works
  • Step 1: Enable autocomplete for the location field
  • Optional: Limit autocomplete to one country
  • Step 2: Select the map system
  • Step 3: Disable city and area dropdowns in submission
  • Use autocomplete in the Add Listing form
  • Use autocomplete in search forms
  • Search forms that support the location field
  • Troubleshooting
  • Important notes
  • Related help

How Autocomplete Works

When autocomplete is enabled, users can start typing a location in the location field and select one of the suggested results.

The suggestion list is provided by the selected location service:

  • Google Places, if you use Google Maps.
  • OpenStreet Places, if you use OpenStreetMaps.

After the user selects a suggestion, WPRentals can use the selected location to save listing location details and to search listings by location.

Important: Users should select a result from the autocomplete dropdown. If they only type the location manually and do not select a suggestion, the location may not be saved or searched correctly.

Step 1: Enable Autocomplete for the Location Field

Go to:

WPRentals Options > Search > Location Field Search Settings

Set:

  • Use Google Places or Open Street Places for Location Field in Search? – Yes
  • Use Dropdowns for Cities and Areas in Submission Form? – No

Click Save Changes.

Enable Google Places or OpenStreet Places for the location field in WPRentals

Optional: Limit Autocomplete to One Country

You can limit Google Places or OpenStreet Places suggestions to a specific country.

Use this option if your website lists rentals only in one country and you want autocomplete suggestions to stay focused on that country.

Limit Google Places or OpenStreet Places to a specific country

Step 2: Select the Map System

Go to:

WPRentals Options > Map Configuration > Map General Settings

Find:

What Map System do you want to use?

Select one of these options:

  • Google Maps
  • OpenStreetMaps

If You Use Google Maps

  • Add a valid Google Maps API Key.
  • Make sure the Places API/library is enabled for that key.

How to generate a Google API key

Select Google Maps or OpenStreetMaps in WPRentals Map General Settings

If You Use OpenStreetMaps

  • Select OpenStreetMaps as the map system.
  • Enable OpenStreet Places.
  • Click Save Changes.



Step 3: Disable City and Area Dropdowns in Submission

When using Google Places or OpenStreet Places, the location should be selected from the autocomplete suggestion.

Go to:

WPRentals Options > Search > Location Field Search Settings

Set:

Use Dropdowns for Cities and Areas in Submission Form? – No



Why this is needed: If city and area dropdowns are enabled, the submit form uses the dropdown location system. If you want Google Places or OpenStreet Places autocomplete, the city and area dropdowns should be disabled.

Use Autocomplete in the Add Listing Form

After the settings are configured, owners and site admins can select the listing location from the front-end submit form.

Go to:

User Dashboard > My Listings > Add New Listing

or:

User Dashboard > My Listings > Edit Listing

  1. Fill in the required listing fields.
  2. In the City or location field, start typing a city or location name.
  3. Select the correct result from the autocomplete dropdown.
  4. The country and other location details can be populated based on the selected result.
  5. Complete the remaining listing details.
  6. Save, submit, or update the listing.


Use autocomplete in the WPRentals Add New Listing form


Location details populated after selecting autocomplete result

Use Autocomplete in Search Forms

Visitors can also use the autocomplete location field in search forms.

  1. Go to a page that includes a WPRentals search form.
  2. Start typing a location in the location field.
  3. Select the matching result from the autocomplete dropdown.
  4. Click Search.
  5. The search results page will show listings that match the selected location.


Search listings using Google Places or OpenStreet autocomplete

Search Forms That Support the Location Field

The Google Places or OpenStreet Places autocomplete setting applies to search forms that include a supported location field.

Hero Media Search

Hero Media Search is available in several variations.

Advanced Search Form settings

  • Type 1 – default search, hardcoded fields.
  • Type 2 – default search, hardcoded fields.
  • Type 3 – supports custom fields only.
  • Type 4 – default fields and custom fields.
  • Type 5 – supports custom fields only.

These search forms can also appear as:

  • Mobile Search
  • Search Shortcode
  • Search Widget

Half Map Layout Search

The Half Map search form is configured with custom fields.

Half Map Search Form

Search Form Builder in Elementor

The Elementor Search Form Builder is configured with custom fields.

WPRentals Search Form Builder for Elementor

Examples of Location Fields in Search Forms

The location field can appear as the default field:

Where do you want to go?


Default location search field in WPRentals

The location field can also appear as a custom field:

Location



In the Elementor Search Form Builder, use the field:

Location


Location field in WPRentals Elementor Search Form Builder

Troubleshooting

If location suggestions do not show, check the following:

  • The correct map system is selected in Map Configuration.
  • Google Maps has a valid API key, if using Google Maps.
  • The Google Places API/library is enabled for the API key.
  • OpenStreetMaps is selected if using OpenStreet Places.
  • Use Google Places or Open Street Places for Location Field in Search? is set to Yes.
  • Use Dropdowns for Cities and Areas in Submission Form? is set to No.
  • Users select a result from the autocomplete dropdown instead of typing manually.
  • Cache was cleared after changing the settings.
  • The browser console does not show JavaScript or API errors.

Important Notes

  • Google Places requires a valid Google Maps API key with the Places API/library enabled.
  • OpenStreet Places requires OpenStreetMaps to be selected as the map system.
  • Set Use Google Places or Open Street Places for Location Field in Search? to Yes to use autocomplete.
  • Set Use Dropdowns for Cities and Areas in Submission Form? to No when using Google/OpenStreet autocomplete for location saving.
  • Owners and site admins manage listing locations from the front-end dashboard.
  • Visitors search locations from search forms that include the supported location field.
  • The autocomplete setting applies only to search forms that include a supported location field.

Related Help

Theme auto-save location based on saved listing location details

Dropdown selector for city and area

How to generate a Google API key

Advanced Search Form settings

Half Map Search Form

WPRentals Search Form Builder for Elementor

Advanced SearchWP Rentals Theme Options

Related Articles

  • What Is the WPESTATE FAN Option
  • White-Label WPRentals with Your Brand
  • Orphan Listings and Auto Delete Option in WPRentals
  • Theme Options -> Payment Currency Settings

HELP CATEGORIES

  • 61. General
  • 72. Installation & Basic Setup
  • 373. How Booking Works
  • 18Advanced Search
  • 17Elementor WPRentals Studio
  • 14Email Notifications
  • 23FAQ
  • 14Installation FAQ
  • 10Menu Options
  • 34Owner & Renter
  • 8Page Templates
  • 23Property / Listing
  • 22Shortcodes
  • 4Supported Maps
  • 98Technical how to
  • 5Third Party plugins
  • 4Translation & Multi Languages
  • 3WordPress Blog Post
  • 13WordPress Widgets
  • 12WP Rentals Payments
  • 79WP Rentals Theme Options
  • 26WPML & Weglot

Join Us On

Powered by WP Estate - All Rights Reserved
  • Client Support
  • Video Tutorials
  • WPRentals
  • WPEstate
  • API