Stay organized with collections
Save and categorize content based on your preferences.
This migration guide is for developers who have an integration with the Place
Autocomplete Widget (Preview) prior to version 3.59.8.
This guide shows you the changes you need to make to use the latest version.
Changes
The gmp-placeselect event has been renamed to gmp-select.
The gmp-select event now returns a placePrediction instance rather than a
place instance. PlacePrediction.toPlace() returns the proper Place
object.
The gmp-requesterror event is now gmp-error.
Migration steps
To migrate your Place Autocomplete Widget integration to the latest version,
do the following:
Verify that Places API (New) is enabled for your project in the Cloud
console.
Add Places API (New) to the API restrictions list for the API key that
you're using.
In your development environment, perform and test the following changes:
Update event listener
Change gmp-placeselect to gmp-select as shown in the following snippets:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Migrate to the new Autocomplete Widget\n\n\u003cbr /\u003e\n\nThis migration guide is for developers who have an integration with the Place\nAutocomplete Widget (Preview) prior to [version 3.59.8](/maps/documentation/javascript/releases#3.59.8).\nThis guide shows you the changes you need to make to use the latest version.\n\nChanges\n-------\n\n- The `gmp-placeselect` event has been renamed to `gmp-select`.\n- The `gmp-select` event now returns a `placePrediction` instance rather than a `place` instance. `PlacePrediction.toPlace()` returns the proper `Place` object.\n- The `gmp-requesterror` event is now `gmp-error`.\n\nMigration steps\n---------------\n\nTo migrate your Place Autocomplete Widget integration to the latest version,\ndo the following:\n\n1. Verify that **Places API (New)** is enabled for your project in the Cloud console.\n2. Add **Places API (New)** to the API restrictions list for the API key that you're using.\n3. In your development environment, perform and test the following changes:\n\n### Update event listener\n\nChange `gmp-placeselect` to `gmp-select` as shown in the following snippets:\n\n#### Before\n\n autocompleteElement.addEventListener('gmp-placeselect', (event) =\u003e {\n console.log(event.place);\n });\n\n#### After\n\n autocompleteElement.addEventListener('gmp-select', (event) =\u003e {\n console.log(event.placePrediction.toPlace());\n });\n\n### Change `componentRestrictions` to `includedRegionCodes`\n\nChange instances of `componentRestrictions` to use the `includedRegionCodes`\nfield, as shown in the following snippets.\n\n#### Before\n\n const autocompleteElement = new google.maps.places.PlaceAutocompleteElement({\n componentRestrictions: {country: ['US']},\n ...\n });\n\n#### After\n\n const autocompleteElement = new google.maps.places.PlaceAutocompleteElement({\n includedRegionCodes: ['US'],\n ...\n\n### Change `types` to `includedPrimaryTypes`\n\nChange instances of `types` to use the `includedPrimaryTypes` field, as shown in\nthe following snippets.\n\n#### Before\n\n const autocompleteElement = new google.maps.places.PlaceAutocompleteElement({\n types: ['restaurant'],\n });\n\n#### After\n\n const autocompleteElement = new google.maps.places.PlaceAutocompleteElement({\n includedPrimaryTypes: ['restaurant'],\n });\n\n### Change `gmp-requesterror` to `gmp-error`\n\nChange instances of `gmp-requesterror` to `gmp-error`, as shown in the following\nsnippets:\n\n#### Before\n\n autocompleteElement.addEventListener('gmp-requesterror', (event) =\u003e {\n console.log('an error occurred');\n });\n\n#### After\n\n autocompleteElement.addEventListener('gmp-error', (event) =\u003e {\n console.log('an error occurred');\n });"]]