The search Map Mode
Learn how to use the search map mode on an embedded map.
We'll cover the following
The search
map mode
The search
mode displays the results of a search across a map. It requires the q
parameter, which defines the search term. The base URL of this map mode looks like this: https://www.google.com/maps/embed/v1/search?key=API_KEY&PARAMETERS
The search
map mode parameters
We can use the following parameters in the search
map mode:
Parameters | Category | Description |
| Required | This parameter defines the search term. It accepts plus codes or URL-encoded addresses as input. |
| Optional | This parameter sets the center of the map view. It accepts comma-separated latitude and longitude values. |
| Optional | This parameter sets the initial zoom level of the map view. It accepts integer values ranging from The maximum possible zoom value varies depending on the location but is usually |
| Optional | This parameter defines which map type loads. It only accepts |
| Optional | This parameter defines the language for the UI elements and labels on the map. It accepts a two-character ccTLD region code as input. |
| Optional | This parameter defines the appropriate borders and labels to display, and tailors them according to the geopolitical sensitivities of a region. It accepts a two-character ccTLD region code as input. |
Code example
In the code example below, we run a search query in the request URL to display the locations of gyms across Seattle:
In lines 13–15 of the HTML file, we pass the value gyms+in+Seattle
to the q
parameter in the request URL. With this request, the Maps Embed API runs the search query and displays the map of Seattle with markers placed on each resulting gym location.